Convert all line endings to LF.
authorJohn Abd-El-Malek <jabdelmalek@google.com>
Sat, 24 May 2014 00:28:10 +0000 (17:28 -0700)
committerJohn Abd-El-Malek <jabdelmalek@google.com>
Sat, 24 May 2014 00:41:56 +0000 (17:41 -0700)
526 files changed:
README [new file with mode: 0644]
README.txt [deleted file]
build/all.gyp
build/gyp_pdfium.py
build/standalone.gypi
core/include/fdrm/fx_crypt.h
core/include/fpdfapi/fpdf_module.h
core/include/fpdfapi/fpdf_objects.h
core/include/fpdfapi/fpdf_page.h
core/include/fpdfapi/fpdf_pageobj.h
core/include/fpdfapi/fpdf_parser.h
core/include/fpdfapi/fpdf_render.h
core/include/fpdfapi/fpdf_resource.h
core/include/fpdfapi/fpdf_serial.h
core/include/fpdfapi/fpdfapi.h
core/include/fpdfdoc/fpdf_ap.h
core/include/fpdfdoc/fpdf_doc.h
core/include/fpdfdoc/fpdf_tagged.h
core/include/fpdfdoc/fpdf_vt.h
core/include/fpdftext/fpdf_text.h
core/include/fxcodec/fx_codec.h
core/include/fxcodec/fx_codec_def.h
core/include/fxcodec/fx_codec_provider.h
core/include/fxcrt/fx_basic.h
core/include/fxcrt/fx_coordinates.h
core/include/fxcrt/fx_ext.h
core/include/fxcrt/fx_memory.h
core/include/fxcrt/fx_stream.h
core/include/fxcrt/fx_string.h
core/include/fxcrt/fx_system.h
core/include/fxcrt/fx_xml.h
core/include/fxge/fx_dib.h
core/include/fxge/fx_font.h
core/include/fxge/fx_freetype.h
core/include/fxge/fx_ge.h
core/include/fxge/fx_ge_apple.h
core/include/fxge/fx_ge_win32.h
core/include/thirdparties/freetype/foxitnames.h
core/include/thirdparties/freetype/freetype/config/ftconfig.h
core/include/thirdparties/freetype/freetype/freetype.h
core/include/thirdparties/freetype/freetype/ftsystem.h
core/include/thirdparties/freetype/freetype/internal/ftmemory.h
core/include/thirdparties/freetype/ft2build.h
core/include/thirdparties/libjpeg/jconfig.h
core/include/thirdparties/libjpeg/jerror.h
core/include/thirdparties/libjpeg/jmorecfg.h
core/include/thirdparties/libjpeg/jpegint.h
core/include/thirdparties/libjpeg/jpeglib.h
core/include/thirdparties/zlib/zconf.h
core/include/thirdparties/zlib/zlib.h
core/src/fdrm/crypto/fx_crypt.cpp
core/src/fdrm/crypto/fx_crypt_aes.cpp
core/src/fdrm/crypto/fx_crypt_sha.cpp
core/src/fpdfapi/fpdf_basic_module.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/B5pc-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/CNS-EUC-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/ETen-B5-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/ETenms-B5-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/CNS1/UniCNS-UTF16-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/GB-EUC-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/GBK-EUC-H_2.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/GBKp-EUC-H_2.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/GBpc-EUC-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/GB1/UniGB-UCS2-H_4.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/83pv-RKSJ-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/90ms-RKSJ-H_2.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/90msp-RKSJ-H_2.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/90pv-RKSJ-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/Add-RKSJ-V_1.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/Adobe-Japan1-UCS2_4.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/EUC-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-HW-V_4.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-H_4.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UCS2-V_4.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-H_5.cpp
core/src/fpdfapi/fpdf_cmaps/Japan1/UniJIS-UTF16-V_5.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/Adobe-Korea1-UCS2_2.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/KSC-EUC-V_0.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-HW-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/KSCms-UHC-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/KSCpc-EUC-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UCS2-H_1.cpp
core/src/fpdfapi/fpdf_cmaps/Korea1/UniKS-UTF16-H_0.cpp
core/src/fpdfapi/fpdf_cmaps/cmap_int.h
core/src/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
core/src/fpdfapi/fpdf_edit/editint.h
core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
core/src/fpdfapi/fpdf_font/common.h
core/src/fpdfapi/fpdf_font/font_int.h
core/src/fpdfapi/fpdf_font/fpdf_font.cpp
core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
core/src/fpdfapi/fpdf_font/fpdf_font_utility.cpp
core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
core/src/fpdfapi/fpdf_font/ttgsubtable.h
core/src/fpdfapi/fpdf_page/fpdf_page.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_parser_new.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp
core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
core/src/fpdfapi/fpdf_page/pageint.h
core/src/fpdfapi/fpdf_parser/filters_int.h
core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_encrypt.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_filters.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
core/src/fpdfapi/fpdf_render/fpdf_render.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
core/src/fpdfapi/fpdf_render/render_int.h
core/src/fpdfdoc/doc_action.cpp
core/src/fpdfdoc/doc_annot.cpp
core/src/fpdfdoc/doc_ap.cpp
core/src/fpdfdoc/doc_basic.cpp
core/src/fpdfdoc/doc_bookmark.cpp
core/src/fpdfdoc/doc_form.cpp
core/src/fpdfdoc/doc_formcontrol.cpp
core/src/fpdfdoc/doc_formfield.cpp
core/src/fpdfdoc/doc_link.cpp
core/src/fpdfdoc/doc_metadata.cpp
core/src/fpdfdoc/doc_ocg.cpp
core/src/fpdfdoc/doc_tagged.cpp
core/src/fpdfdoc/doc_utils.cpp
core/src/fpdfdoc/doc_viewerPreferences.cpp
core/src/fpdfdoc/doc_vt.cpp
core/src/fpdfdoc/doc_vtmodule.cpp
core/src/fpdfdoc/pdf_vt.h
core/src/fpdfdoc/tagged_int.h
core/src/fpdftext/fpdf_text.cpp
core/src/fpdftext/fpdf_text_int.cpp
core/src/fpdftext/fpdf_text_search.cpp
core/src/fpdftext/text_int.h
core/src/fpdftext/txtproc.h
core/src/fpdftext/unicodenormalization.cpp
core/src/fpdftext/unicodenormalizationdata.cpp
core/src/fx_freetype.h
core/src/fx_jpeglib.h
core/src/fx_zlib.h
core/src/fxcodec/codec/codec_int.h
core/src/fxcodec/codec/fx_codec.cpp
core/src/fxcodec/codec/fx_codec_fax.cpp
core/src/fxcodec/codec/fx_codec_flate.cpp
core/src/fxcodec/codec/fx_codec_icc.cpp
core/src/fxcodec/codec/fx_codec_jbig.cpp
core/src/fxcodec/codec/fx_codec_jpeg.cpp
core/src/fxcodec/codec/fx_codec_jpx_opj.cpp
core/src/fxcodec/jbig2/JBig2_ArithDecoder.h
core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.h
core/src/fxcodec/jbig2/JBig2_ArithQe.h
core/src/fxcodec/jbig2/JBig2_BitStream.h
core/src/fxcodec/jbig2/JBig2_Context.cpp
core/src/fxcodec/jbig2/JBig2_Context.h
core/src/fxcodec/jbig2/JBig2_Define.h
core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp
core/src/fxcodec/jbig2/JBig2_GeneralDecoder.h
core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
core/src/fxcodec/jbig2/JBig2_HuffmanDecoder.h
core/src/fxcodec/jbig2/JBig2_HuffmanTable.cpp
core/src/fxcodec/jbig2/JBig2_HuffmanTable.h
core/src/fxcodec/jbig2/JBig2_HuffmanTable_Standard.h
core/src/fxcodec/jbig2/JBig2_Image.cpp
core/src/fxcodec/jbig2/JBig2_Image.h
core/src/fxcodec/jbig2/JBig2_List.h
core/src/fxcodec/jbig2/JBig2_Module.h
core/src/fxcodec/jbig2/JBig2_Object.cpp
core/src/fxcodec/jbig2/JBig2_Object.h
core/src/fxcodec/jbig2/JBig2_Page.h
core/src/fxcodec/jbig2/JBig2_PatternDict.cpp
core/src/fxcodec/jbig2/JBig2_PatternDict.h
core/src/fxcodec/jbig2/JBig2_Segment.cpp
core/src/fxcodec/jbig2/JBig2_Segment.h
core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
core/src/fxcodec/jbig2/JBig2_SymbolDict.h
core/src/fxcodec/lcms2/include/fx_lcms2.h
core/src/fxcodec/lcms2/include/fx_lcms2_plugin.h
core/src/fxcodec/lcms2/lcms2-2.6/src/cmserr.c
core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgmt.c
core/src/fxcodec/lcms2/src/fx_cmscam02.c
core/src/fxcodec/lcms2/src/fx_cmscgats.c
core/src/fxcodec/lcms2/src/fx_cmscnvrt.c
core/src/fxcodec/lcms2/src/fx_cmserr.c
core/src/fxcodec/lcms2/src/fx_cmsgamma.c
core/src/fxcodec/lcms2/src/fx_cmsgmt.c
core/src/fxcodec/lcms2/src/fx_cmshalf.c
core/src/fxcodec/lcms2/src/fx_cmsintrp.c
core/src/fxcodec/lcms2/src/fx_cmsio0.c
core/src/fxcodec/lcms2/src/fx_cmsio1.c
core/src/fxcodec/lcms2/src/fx_cmslut.c
core/src/fxcodec/lcms2/src/fx_cmsmd5.c
core/src/fxcodec/lcms2/src/fx_cmsmtrx.c
core/src/fxcodec/lcms2/src/fx_cmsnamed.c
core/src/fxcodec/lcms2/src/fx_cmsopt.c
core/src/fxcodec/lcms2/src/fx_cmspack.c
core/src/fxcodec/lcms2/src/fx_cmspcs.c
core/src/fxcodec/lcms2/src/fx_cmsplugin.c
core/src/fxcodec/lcms2/src/fx_cmsps2.c
core/src/fxcodec/lcms2/src/fx_cmssamp.c
core/src/fxcodec/lcms2/src/fx_cmssm.c
core/src/fxcodec/lcms2/src/fx_cmstypes.c
core/src/fxcodec/lcms2/src/fx_cmsvirt.c
core/src/fxcodec/lcms2/src/fx_cmswtpnt.c
core/src/fxcodec/lcms2/src/fx_cmsxform.c
core/src/fxcodec/libjpeg/cderror.h
core/src/fxcodec/libjpeg/cdjpeg.h
core/src/fxcodec/libjpeg/fpdfapi_jcapimin.c
core/src/fxcodec/libjpeg/fpdfapi_jcapistd.c
core/src/fxcodec/libjpeg/fpdfapi_jccoefct.c
core/src/fxcodec/libjpeg/fpdfapi_jccolor.c
core/src/fxcodec/libjpeg/fpdfapi_jcdctmgr.c
core/src/fxcodec/libjpeg/fpdfapi_jchuff.c
core/src/fxcodec/libjpeg/fpdfapi_jcinit.c
core/src/fxcodec/libjpeg/fpdfapi_jcmainct.c
core/src/fxcodec/libjpeg/fpdfapi_jcmarker.c
core/src/fxcodec/libjpeg/fpdfapi_jcmaster.c
core/src/fxcodec/libjpeg/fpdfapi_jcomapi.c
core/src/fxcodec/libjpeg/fpdfapi_jcparam.c
core/src/fxcodec/libjpeg/fpdfapi_jcphuff.c
core/src/fxcodec/libjpeg/fpdfapi_jcprepct.c
core/src/fxcodec/libjpeg/fpdfapi_jcsample.c
core/src/fxcodec/libjpeg/fpdfapi_jctrans.c
core/src/fxcodec/libjpeg/fpdfapi_jdapimin.c
core/src/fxcodec/libjpeg/fpdfapi_jdapistd.c
core/src/fxcodec/libjpeg/fpdfapi_jdcoefct.c
core/src/fxcodec/libjpeg/fpdfapi_jdcolor.c
core/src/fxcodec/libjpeg/fpdfapi_jddctmgr.c
core/src/fxcodec/libjpeg/fpdfapi_jdhuff.c
core/src/fxcodec/libjpeg/fpdfapi_jdinput.c
core/src/fxcodec/libjpeg/fpdfapi_jdmainct.c
core/src/fxcodec/libjpeg/fpdfapi_jdmarker.c
core/src/fxcodec/libjpeg/fpdfapi_jdmaster.c
core/src/fxcodec/libjpeg/fpdfapi_jdmerge.c
core/src/fxcodec/libjpeg/fpdfapi_jdphuff.c
core/src/fxcodec/libjpeg/fpdfapi_jdpostct.c
core/src/fxcodec/libjpeg/fpdfapi_jdsample.c
core/src/fxcodec/libjpeg/fpdfapi_jdtrans.c
core/src/fxcodec/libjpeg/fpdfapi_jerror.c
core/src/fxcodec/libjpeg/fpdfapi_jfdctfst.c
core/src/fxcodec/libjpeg/fpdfapi_jfdctint.c
core/src/fxcodec/libjpeg/fpdfapi_jidctfst.c
core/src/fxcodec/libjpeg/fpdfapi_jidctint.c
core/src/fxcodec/libjpeg/fpdfapi_jidctred.c
core/src/fxcodec/libjpeg/fpdfapi_jmemmgr.c
core/src/fxcodec/libjpeg/fpdfapi_jmemnobs.c
core/src/fxcodec/libjpeg/fpdfapi_jutils.c
core/src/fxcodec/libjpeg/jchuff.h
core/src/fxcodec/libjpeg/jconfig.h
core/src/fxcodec/libjpeg/jdct.h
core/src/fxcodec/libjpeg/jdhuff.h
core/src/fxcodec/libjpeg/jerror.h
core/src/fxcodec/libjpeg/jinclude.h
core/src/fxcodec/libjpeg/jmemsys.h
core/src/fxcodec/libjpeg/jmorecfg.h
core/src/fxcodec/libjpeg/jpegint.h
core/src/fxcodec/libjpeg/jpeglib.h
core/src/fxcodec/libjpeg/jversion.h
core/src/fxcodec/libjpeg/transupp.h
core/src/fxcrt/extension.h
core/src/fxcrt/fx_basic_array.cpp
core/src/fxcrt/fx_basic_bstring.cpp
core/src/fxcrt/fx_basic_buffer.cpp
core/src/fxcrt/fx_basic_coords.cpp
core/src/fxcrt/fx_basic_gcc.cpp
core/src/fxcrt/fx_basic_list.cpp
core/src/fxcrt/fx_basic_maps.cpp
core/src/fxcrt/fx_basic_memmgr.cpp
core/src/fxcrt/fx_basic_memmgr_mini.cpp
core/src/fxcrt/fx_basic_plex.cpp
core/src/fxcrt/fx_basic_utf.cpp
core/src/fxcrt/fx_basic_util.cpp
core/src/fxcrt/fx_basic_wstring.cpp
core/src/fxcrt/fx_extension.cpp
core/src/fxcrt/fx_xml_composer.cpp
core/src/fxcrt/fx_xml_parser.cpp
core/src/fxcrt/fxcrt_platforms.cpp
core/src/fxcrt/fxcrt_platforms.h
core/src/fxcrt/fxcrt_posix.cpp
core/src/fxcrt/fxcrt_posix.h
core/src/fxcrt/fxcrt_windows.cpp
core/src/fxcrt/fxcrt_windows.h
core/src/fxcrt/mem_int.h
core/src/fxcrt/plex.h
core/src/fxcrt/xml_int.h
core/src/fxge/Microsoft SDK/include/DWrite.h
core/src/fxge/Microsoft SDK/include/Dcommon.h
core/src/fxge/Microsoft SDK/include/GdiPlus.h
core/src/fxge/Microsoft SDK/include/GdiPlusBase.h
core/src/fxge/Microsoft SDK/include/GdiPlusBitmap.h
core/src/fxge/Microsoft SDK/include/GdiPlusBrush.h
core/src/fxge/Microsoft SDK/include/GdiPlusCachedBitmap.h
core/src/fxge/Microsoft SDK/include/GdiPlusColor.h
core/src/fxge/Microsoft SDK/include/GdiPlusColorMatrix.h
core/src/fxge/Microsoft SDK/include/GdiPlusEnums.h
core/src/fxge/Microsoft SDK/include/GdiPlusFlat.h
core/src/fxge/Microsoft SDK/include/GdiPlusFont.h
core/src/fxge/Microsoft SDK/include/GdiPlusFontCollection.h
core/src/fxge/Microsoft SDK/include/GdiPlusFontFamily.h
core/src/fxge/Microsoft SDK/include/GdiPlusGpStubs.h
core/src/fxge/Microsoft SDK/include/GdiPlusGraphics.h
core/src/fxge/Microsoft SDK/include/GdiPlusHeaders.h
core/src/fxge/Microsoft SDK/include/GdiPlusImageCodec.h
core/src/fxge/Microsoft SDK/include/GdiPlusImaging.h
core/src/fxge/Microsoft SDK/include/GdiPlusLineCaps.h
core/src/fxge/Microsoft SDK/include/GdiPlusMatrix.h
core/src/fxge/Microsoft SDK/include/GdiPlusMem.h
core/src/fxge/Microsoft SDK/include/GdiPlusMetaFile.h
core/src/fxge/Microsoft SDK/include/GdiPlusMetaHeader.h
core/src/fxge/Microsoft SDK/include/GdiPlusPath.h
core/src/fxge/Microsoft SDK/include/GdiPlusPen.h
core/src/fxge/Microsoft SDK/include/GdiPlusPixelFormats.h
core/src/fxge/Microsoft SDK/include/GdiPlusRegion.h
core/src/fxge/Microsoft SDK/include/GdiPlusStringFormat.h
core/src/fxge/Microsoft SDK/include/GdiPlusTypes.h
core/src/fxge/Microsoft SDK/include/GdiPlusimageAttributes.h
core/src/fxge/Microsoft SDK/include/GdiplusInit.h
core/src/fxge/Microsoft SDK/include/sal.h
core/src/fxge/Microsoft SDK/include/specstrings.h
core/src/fxge/apple/apple_int.h
core/src/fxge/apple/fx_apple_platform.cpp
core/src/fxge/apple/fx_mac_imp.cpp
core/src/fxge/apple/fx_quartz_device.cpp
core/src/fxge/dib/dib_int.h
core/src/fxge/dib/fx_dib_composite.cpp
core/src/fxge/dib/fx_dib_convert.cpp
core/src/fxge/dib/fx_dib_engine.cpp
core/src/fxge/dib/fx_dib_main.cpp
core/src/fxge/dib/fx_dib_transform.cpp
core/src/fxge/ge/fx_ge.cpp
core/src/fxge/ge/fx_ge_device.cpp
core/src/fxge/ge/fx_ge_font.cpp
core/src/fxge/ge/fx_ge_fontmap.cpp
core/src/fxge/ge/fx_ge_linux.cpp
core/src/fxge/ge/fx_ge_path.cpp
core/src/fxge/ge/fx_ge_ps.cpp
core/src/fxge/ge/fx_ge_text.cpp
core/src/fxge/ge/text_int.h
core/src/fxge/win32/dwrite_int.h
core/src/fxge/win32/fx_win32_device.cpp
core/src/fxge/win32/fx_win32_dib.cpp
core/src/fxge/win32/fx_win32_dwrite.cpp
core/src/fxge/win32/fx_win32_gdipext.cpp
core/src/fxge/win32/fx_win32_print.cpp
core/src/fxge/win32/win32_int.h
fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h
fpdfsdk/include/formfiller/FFL_CheckBox.h
fpdfsdk/include/formfiller/FFL_ComboBox.h
fpdfsdk/include/formfiller/FFL_FormFiller.h
fpdfsdk/include/formfiller/FFL_IFormFiller.h
fpdfsdk/include/formfiller/FFL_ListBox.h
fpdfsdk/include/formfiller/FFL_Notify.h
fpdfsdk/include/formfiller/FFL_PushButton.h
fpdfsdk/include/formfiller/FFL_RadioButton.h
fpdfsdk/include/formfiller/FFL_TextField.h
fpdfsdk/include/formfiller/FFL_Utils.h
fpdfsdk/include/formfiller/FormFiller.h
fpdfsdk/include/fpdf_dataavail.h
fpdfsdk/include/fpdf_ext.h
fpdfsdk/include/fpdf_flatten.h
fpdfsdk/include/fpdf_fwlevent.h
fpdfsdk/include/fpdf_progressive.h
fpdfsdk/include/fpdf_searchex.h
fpdfsdk/include/fpdf_transformpage.h
fpdfsdk/include/fpdfdoc.h
fpdfsdk/include/fpdfedit.h
fpdfsdk/include/fpdfformfill.h
fpdfsdk/include/fpdfoom.h
fpdfsdk/include/fpdfppo.h
fpdfsdk/include/fpdfsave.h
fpdfsdk/include/fpdftext.h
fpdfsdk/include/fpdfview.h
fpdfsdk/include/fsdk_actionhandler.h
fpdfsdk/include/fsdk_annothandler.h
fpdfsdk/include/fsdk_baseannot.h
fpdfsdk/include/fsdk_baseform.h
fpdfsdk/include/fsdk_common.h
fpdfsdk/include/fsdk_define.h
fpdfsdk/include/fsdk_mgr.h
fpdfsdk/include/fsdk_rendercontext.h
fpdfsdk/include/fx_systemhandler.h
fpdfsdk/include/fxedit/fx_edit.h
fpdfsdk/include/fxedit/fxet_edit.h
fpdfsdk/include/fxedit/fxet_list.h
fpdfsdk/include/fxedit/fxet_stub.h
fpdfsdk/include/javascript/Consts.h
fpdfsdk/include/javascript/Document.h
fpdfsdk/include/javascript/Field.h
fpdfsdk/include/javascript/IJavaScript.h
fpdfsdk/include/javascript/Icon.h
fpdfsdk/include/javascript/JS_Console.h
fpdfsdk/include/javascript/JS_Context.h
fpdfsdk/include/javascript/JS_Define.h
fpdfsdk/include/javascript/JS_EventHandler.h
fpdfsdk/include/javascript/JS_GlobalData.h
fpdfsdk/include/javascript/JS_Module.h
fpdfsdk/include/javascript/JS_Object.h
fpdfsdk/include/javascript/JS_Runtime.h
fpdfsdk/include/javascript/JS_Value.h
fpdfsdk/include/javascript/JavaScript.h
fpdfsdk/include/javascript/PublicMethods.h
fpdfsdk/include/javascript/app.h
fpdfsdk/include/javascript/color.h
fpdfsdk/include/javascript/console.h
fpdfsdk/include/javascript/event.h
fpdfsdk/include/javascript/global.h
fpdfsdk/include/javascript/report.h
fpdfsdk/include/javascript/resource.h
fpdfsdk/include/javascript/util.h
fpdfsdk/include/pdfwindow/IPDFWindow.h
fpdfsdk/include/pdfwindow/PDFWindow.h
fpdfsdk/include/pdfwindow/PWL_Button.h
fpdfsdk/include/pdfwindow/PWL_Caret.h
fpdfsdk/include/pdfwindow/PWL_ComboBox.h
fpdfsdk/include/pdfwindow/PWL_Edit.h
fpdfsdk/include/pdfwindow/PWL_EditCtrl.h
fpdfsdk/include/pdfwindow/PWL_FontMap.h
fpdfsdk/include/pdfwindow/PWL_Icon.h
fpdfsdk/include/pdfwindow/PWL_IconList.h
fpdfsdk/include/pdfwindow/PWL_Label.h
fpdfsdk/include/pdfwindow/PWL_ListBox.h
fpdfsdk/include/pdfwindow/PWL_ListCtrl.h
fpdfsdk/include/pdfwindow/PWL_Note.h
fpdfsdk/include/pdfwindow/PWL_ScrollBar.h
fpdfsdk/include/pdfwindow/PWL_Signature.h
fpdfsdk/include/pdfwindow/PWL_SpecialButton.h
fpdfsdk/include/pdfwindow/PWL_Utils.h
fpdfsdk/include/pdfwindow/PWL_Wnd.h
fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp
fpdfsdk/src/formfiller/FFL_CheckBox.cpp
fpdfsdk/src/formfiller/FFL_ComboBox.cpp
fpdfsdk/src/formfiller/FFL_FormFiller.cpp
fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
fpdfsdk/src/formfiller/FFL_ListBox.cpp
fpdfsdk/src/formfiller/FFL_Notify.cpp
fpdfsdk/src/formfiller/FFL_PushButton.cpp
fpdfsdk/src/formfiller/FFL_RadioButton.cpp
fpdfsdk/src/formfiller/FFL_TextField.cpp
fpdfsdk/src/formfiller/FFL_Utils.cpp
fpdfsdk/src/fpdf_dataavail.cpp
fpdfsdk/src/fpdf_ext.cpp
fpdfsdk/src/fpdf_flatten.cpp
fpdfsdk/src/fpdf_progressive.cpp
fpdfsdk/src/fpdf_searchex.cpp
fpdfsdk/src/fpdf_transformpage.cpp
fpdfsdk/src/fpdfdoc.cpp
fpdfsdk/src/fpdfeditimg.cpp
fpdfsdk/src/fpdfeditpage.cpp
fpdfsdk/src/fpdfformfill.cpp
fpdfsdk/src/fpdfoom.cpp
fpdfsdk/src/fpdfppo.cpp
fpdfsdk/src/fpdfsave.cpp
fpdfsdk/src/fpdfsdkdll.rc
fpdfsdk/src/fpdftext.cpp
fpdfsdk/src/fpdfview.cpp
fpdfsdk/src/fsdk_actionhandler.cpp
fpdfsdk/src/fsdk_annothandler.cpp
fpdfsdk/src/fsdk_baseannot.cpp
fpdfsdk/src/fsdk_baseform.cpp
fpdfsdk/src/fsdk_mgr.cpp
fpdfsdk/src/fsdk_rendercontext.cpp
fpdfsdk/src/fxedit/fxet_ap.cpp
fpdfsdk/src/fxedit/fxet_edit.cpp
fpdfsdk/src/fxedit/fxet_list.cpp
fpdfsdk/src/fxedit/fxet_module.cpp
fpdfsdk/src/fxedit/fxet_pageobjs.cpp
fpdfsdk/src/javascript/Consts.cpp
fpdfsdk/src/javascript/Document.cpp
fpdfsdk/src/javascript/Field.cpp
fpdfsdk/src/javascript/Icon.cpp
fpdfsdk/src/javascript/JS_Context.cpp
fpdfsdk/src/javascript/JS_EventHandler.cpp
fpdfsdk/src/javascript/JS_GlobalData.cpp
fpdfsdk/src/javascript/JS_Object.cpp
fpdfsdk/src/javascript/JS_Runtime.cpp
fpdfsdk/src/javascript/JS_Value.cpp
fpdfsdk/src/javascript/PublicMethods.cpp
fpdfsdk/src/javascript/app.cpp
fpdfsdk/src/javascript/color.cpp
fpdfsdk/src/javascript/console.cpp
fpdfsdk/src/javascript/event.cpp
fpdfsdk/src/javascript/global.cpp
fpdfsdk/src/javascript/report.cpp
fpdfsdk/src/javascript/util.cpp
fpdfsdk/src/pdfwindow/PWL_Button.cpp
fpdfsdk/src/pdfwindow/PWL_Caret.cpp
fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp
fpdfsdk/src/pdfwindow/PWL_Edit.cpp
fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp
fpdfsdk/src/pdfwindow/PWL_FontMap.cpp
fpdfsdk/src/pdfwindow/PWL_Icon.cpp
fpdfsdk/src/pdfwindow/PWL_IconList.cpp
fpdfsdk/src/pdfwindow/PWL_Label.cpp
fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
fpdfsdk/src/pdfwindow/PWL_Note.cpp
fpdfsdk/src/pdfwindow/PWL_ScrollBar.cpp
fpdfsdk/src/pdfwindow/PWL_Signature.cpp
fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp
fpdfsdk/src/pdfwindow/PWL_Utils.cpp
fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
fpdfsdk/src/resource.h
samples/pdfium_test.cc
samples/samples.gyp

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..3a2cbde
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+For build instructions visit https://code.google.com/p/pdfium/wiki/Build
\ No newline at end of file
diff --git a/README.txt b/README.txt
deleted file mode 100644 (file)
index 3a2cbde..0000000
+++ /dev/null
@@ -1 +0,0 @@
-For build instructions visit https://code.google.com/p/pdfium/wiki/Build
\ No newline at end of file
index e9229dd..c97871d 100644 (file)
@@ -1,15 +1,15 @@
-# Copyright 2014 PDFium Authors. All rights reserved.\r
-# Use of this source code is governed by a BSD-style license that can be\r
-# found in the LICENSE file.\r
-\r
-{\r
-  'targets': [\r
-    {\r
-      'target_name': 'All',\r
-      'type': 'none',\r
-      'dependencies': [\r
-        '../samples/samples.gyp:*',\r
-      ],\r
-    }\r
-  ]\r
+# Copyright 2014 PDFium 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
index 9776c30..6831702 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 2014 PDFium Authors. All rights reserved.\r
-# Use of this source code is governed by a BSD-style license that can be\r
-# found in the LICENSE file.\r
-\r
-import os\r
-\r
-path = os.path.abspath(os.path.split(__file__)[0])\r
-execfile(os.path.join(path, 'gyp_pdfium'))\r
+# Copyright 2014 PDFium 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'))
index 970c059..d919c16 100644 (file)
-# Copyright 2014 PDFium Authors. All rights reserved.\r
-# Use of this source code is governed by a BSD-style license that can be\r
-# found in the LICENSE file.\r
-\r
-# Definitions to be used when building stand-alone PDFium binaries.\r
-\r
-{\r
-  'variables': {\r
-    'component%': 'static_library',\r
-    'clang%': 0,\r
-    'msvs_multi_core_compile%': '1',\r
-    'variables': {\r
-      'variables': {\r
-        'variables': {\r
-          'conditions': [\r
-            ['OS=="linux" or OS=="mac"', {\r
-              # This handles the Unix platforms we generally deal with.\r
-              # Anything else gets passed through, which probably won't work\r
-              # very well; such hosts should pass an explicit target_arch\r
-              # to gyp.\r
-              'host_arch%':\r
-                '<!(uname -m | sed -e "s/i.86/ia32/;\\r
-                                       s/x86_64/x64/;\\r
-                                       s/amd64/x64/;\\r
-                                       s/arm.*/arm/;\\r
-                                       s/aarch64/arm64/;\\r
-                                       s/mips.*/mipsel/")',\r
-            }, {\r
-              # OS!="linux" and OS!="mac"\r
-              'host_arch%': 'ia32',\r
-            }],\r
-          ],\r
-        },\r
-        'host_arch%': '<(host_arch)',\r
-        'target_arch%': '<(host_arch)',\r
-      },\r
-      'host_arch%': '<(host_arch)',\r
-      'target_arch%': '<(target_arch)',\r
-    },\r
-    'host_arch%': '<(host_arch)',\r
-    'target_arch%': '<(target_arch)',\r
-    'werror%': '-Werror',\r
-    'v8_optimized_debug%': 0,\r
-    'icu_gyp_path': '../v8/third_party/icu/icu.gyp',\r
-    'conditions': [\r
-      ['OS == "win"', {\r
-        'os_posix%': 0,\r
-      }, {\r
-        'os_posix%': 1,\r
-      }],\r
-    ],\r
-  },\r
-  'target_defaults': {\r
-    'default_configuration': 'Debug',\r
-    'configurations': {\r
-      'Debug': {\r
-        'cflags': [\r
-          '-g',\r
-          '-O0',          \r
-          '-fdata-sections',\r
-          '-ffunction-sections',\r
-        ],\r
-        'msvs_settings': {\r
-          'VCCLCompilerTool': {\r
-            'Optimization': '0',\r
-            'conditions': [\r
-              ['component=="shared_library"', {\r
-                'RuntimeLibrary': '3',  # /MDd\r
-              }, {\r
-                'RuntimeLibrary': '1',  # /MTd\r
-              }],\r
-            ],\r
-          },\r
-          'VCLinkerTool': {\r
-            'LinkIncremental': '2',\r
-          },\r
-        },\r
-        'xcode_settings': {\r
-          'GCC_OPTIMIZATION_LEVEL': '0',  # -O0\r
-        },\r
-      },\r
-      'Release': {\r
-        'cflags': [\r
-          '-fno-strict-aliasing',\r
-        ],\r
-        'xcode_settings': {\r
-          'GCC_OPTIMIZATION_LEVEL': '3',  # -O3\r
-          'GCC_STRICT_ALIASING': 'NO',\r
-        },\r
-        'msvs_settings': {\r
-          'VCCLCompilerTool': {\r
-            'Optimization': '2',\r
-            'InlineFunctionExpansion': '2',\r
-            'EnableIntrinsicFunctions': 'true',\r
-            'FavorSizeOrSpeed': '0',\r
-            'StringPooling': 'true',\r
-            'conditions': [\r
-              ['component=="shared_library"', {\r
-                'RuntimeLibrary': '2',  #/MD\r
-              }, {\r
-                'RuntimeLibrary': '0',  #/MT\r
-              }],\r
-            ],\r
-          },\r
-          'VCLinkerTool': {\r
-            'LinkIncremental': '1',\r
-            'OptimizeReferences': '2',\r
-            'EnableCOMDATFolding': '2',\r
-          },\r
-        },\r
-        'conditions': [\r
-          ['OS=="linux"', {\r
-            'cflags': [\r
-              '-fdata-sections',\r
-              '-ffunction-sections',\r
-              '-O3',\r
-              '-O2',\r
-            ],\r
-          }],\r
-          ['OS=="android"', {\r
-            'cflags!': [\r
-              '-O3',\r
-              '-Os',\r
-            ],\r
-            'cflags': [\r
-              '-fdata-sections',\r
-              '-ffunction-sections',\r
-              '-O2',\r
-            ],\r
-          }],\r
-        ],  # conditions\r
-      },\r
-    },\r
-    'defines!': [\r
-      'DEBUG',\r
-    ],\r
-    'cflags!': [\r
-      '-Wall',\r
-      '-W',\r
-      '-Wno-unused-parameter',\r
-      '-pthread', '-fno-exceptions',\r
-      '-fvisibility=hidden',\r
-    ],\r
-    'cflags_cc': [\r
-      '-Wnon-virtual-dtor',\r
-      '-fno-rtti',\r
-    ],\r
-    'ldflags': [\r
-      '-pthread',\r
-    ],\r
-    'msvs_cygwin_dirs': ['<(DEPTH)/v8/third_party/cygwin'],\r
-    'msvs_configuration_attributes': {\r
-      'OutputDirectory': '<(DEPTH)\\out\\$(ConfigurationName)',\r
-      'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',\r
-      'CharacterSet': '1',\r
-    },\r
-    'msvs_settings': {\r
-      'VCCLCompilerTool': {\r
-        'MinimalRebuild': 'false',\r
-        'BufferSecurityCheck': 'true',\r
-        'EnableFunctionLevelLinking': 'true',\r
-        'RuntimeTypeInfo': 'false',\r
-        'WarningLevel': '3',\r
-        'WarnAsError': 'false',\r
-        'DebugInformationFormat': '3',\r
-        'Detect64BitPortabilityProblems': 'false',\r
-        'conditions': [\r
-          [ 'msvs_multi_core_compile', {\r
-            'AdditionalOptions': ['/MP'],\r
-          }],\r
-          ['component=="shared_library"', {\r
-            'ExceptionHandling': '1',  # /EHsc\r
-          }, {\r
-            'ExceptionHandling': '0',\r
-          }],\r
-        ],\r
-      },\r
-      'VCLibrarianTool': {\r
-        'AdditionalOptions': ['/ignore:4221'],\r
-      },\r
-      'VCLinkerTool': {\r
-        'GenerateDebugInformation': 'true',\r
-        'LinkIncremental': '1',\r
-        # SubSystem values:\r
-        #   0 == not set\r
-        #   1 == /SUBSYSTEM:CONSOLE\r
-        #   2 == /SUBSYSTEM:WINDOWS\r
-        'SubSystem': '1',\r
-        'AdditionalDependencies': [\r
-          'advapi32.lib',\r
-          'gdi32.lib',\r
-          'user32.lib',\r
-        ],\r
-      },\r
-    },\r
-    'xcode_settings': {\r
-      'ALWAYS_SEARCH_USER_PATHS': 'NO',\r
-      'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks\r
-      'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic\r
-                                                # (Equivalent to -fPIC)\r
-      'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions\r
-      'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti\r
-      'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings\r
-      # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden\r
-      'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',\r
-      'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden\r
-      'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',     # -Werror\r
-      'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor\r
-      'SYMROOT': '<(DEPTH)/xcodebuild',\r
-      'USE_HEADERMAP': 'NO',\r
-      'OTHER_CFLAGS': [\r
-        '-fno-strict-aliasing',\r
-      ],\r
-      'WARNING_CFLAGS': [\r
-        '-Wall',\r
-        '-Wendif-labels',\r
-        '-W',\r
-        '-Wno-unused-parameter',\r
-      ],\r
-    },\r
-  },\r
-  'conditions': [\r
-    ['component=="shared_library"', {\r
-      'cflags': [\r
-        '-fPIC',\r
-      ],\r
-    }],\r
-    ['OS=="win"', {\r
-      'target_defaults': {\r
-        'defines': [\r
-          '_CRT_SECURE_NO_DEPRECATE',\r
-          '_CRT_NONSTDC_NO_DEPRECATE',\r
-        ],\r
-        'conditions': [\r
-          ['component=="static_library"', {\r
-            'defines': [\r
-              '_HAS_EXCEPTIONS=0',\r
-            ],\r
-          }],\r
-        ],\r
-      },\r
-    }],  # OS=="win"\r
-    ['OS=="mac"', {\r
-      'target_defaults': {\r
-        'link_settings': {\r
-          'libraries': [\r
-            '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',\r
-            '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',\r
-          ],\r
-        },\r
-        'target_conditions': [\r
-          ['_type!="static_library"', {\r
-            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},\r
-          }],\r
-        ],  # target_conditions\r
-      },  # target_defaults\r
-    }],  # OS=="mac"\r
-  ],\r
+# Copyright 2014 PDFium 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
index 5e0b786..ec7d55a 100644 (file)
@@ -1,43 +1,43 @@
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#ifndef _FX_CRYPT_H_\r
-#define _FX_CRYPT_H_\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-void CRYPT_ArcFourCryptBlock(FX_LPBYTE data, FX_DWORD size, FX_LPCBYTE key, FX_DWORD keylen);\r
-void CRYPT_ArcFourSetup(FX_LPVOID context, FX_LPCBYTE key, FX_DWORD length);\r
-void CRYPT_ArcFourCrypt(FX_LPVOID context, FX_LPBYTE data, FX_DWORD size);\r
-void CRYPT_AESSetKey(FX_LPVOID context, FX_DWORD blocklen, FX_LPCBYTE key, FX_DWORD keylen, FX_BOOL bEncrypt);\r
-void CRYPT_AESSetIV(FX_LPVOID context, FX_LPCBYTE iv);\r
-void CRYPT_AESDecrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size);\r
-void CRYPT_AESEncrypt(FX_LPVOID context, FX_LPBYTE dest, FX_LPCBYTE src, FX_DWORD size);\r
-void CRYPT_MD5Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[16]);\r
-void CRYPT_MD5Start(FX_LPVOID context);\r
-void CRYPT_MD5Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);\r
-void CRYPT_MD5Finish(FX_LPVOID context, FX_BYTE digest[16]);\r
-void CRYPT_SHA1Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[20]);\r
-void CRYPT_SHA1Start(FX_LPVOID context);\r
-void CRYPT_SHA1Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);\r
-void CRYPT_SHA1Finish(FX_LPVOID context, FX_BYTE digest[20]);\r
-void CRYPT_SHA256Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[32]);\r
-void CRYPT_SHA256Start(FX_LPVOID context);\r
-void CRYPT_SHA256Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);\r
-void CRYPT_SHA256Finish(FX_LPVOID context, FX_BYTE digest[32]);\r
-void CRYPT_SHA384Start(FX_LPVOID context);\r
-void CRYPT_SHA384Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);\r
-void CRYPT_SHA384Finish(FX_LPVOID context, FX_BYTE digest[48]);\r
-void CRYPT_SHA384Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[48]);\r
-void CRYPT_SHA512Start(FX_LPVOID context);\r
-void CRYPT_SHA512Update(FX_LPVOID context, FX_LPCBYTE data, FX_DWORD size);\r
-void CRYPT_SHA512Finish(FX_LPVOID context, FX_BYTE digest[64]);\r
-void CRYPT_SHA512Generate(FX_LPCBYTE data, FX_DWORD size, FX_BYTE digest[64]);\r
-void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(FX_LPCBYTE pData, FX_DWORD size, FX_LPBYTE data_buf, FX_DWORD& data_len));\r
-#ifdef __cplusplus\r
-};\r
-#endif\r
-#endif\r
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by 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
index bc11a96..8f0621a 100644 (file)
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#ifndef _FPDF_MODULE_\r
-#define _FPDF_MODULE_\r
-#ifndef _FXCRT_EXTENSION_\r
-#include "../fxcrt/fx_ext.h"\r
-#endif\r
-class CPDF_ModuleMgr;\r
-class CPDF_PageModuleDef;\r
-class CPDF_RenderModuleDef;\r
-class CPDF_SecurityHandler;\r
-class CCodec_ModuleMgr;\r
-class CPDF_Dictionary;\r
-class ICodec_JpegModule;\r
-class ICodec_JpxModule;\r
-class ICodec_FaxModule;\r
-class ICodec_Jbig2Module;\r
-class ICodec_IccModule;\r
-class ICodec_FlateModule;\r
-#define ADDIN_NAME_CJK                 "Eastern Asian Language Support"\r
-#define ADDIN_NAME_DECODER             "JPEG2000 and JBIG2 Image Decoders"\r
-class CPDF_ModuleMgr : public CFX_Object\r
-{\r
-public:\r
-\r
-    static void        Create();\r
-\r
-    static CPDF_ModuleMgr*     Get();\r
-\r
-    static void        Destroy();\r
-\r
-\r
-\r
-    void               SetCodecModule(CCodec_ModuleMgr* pModule)\r
-    {\r
-        m_pCodecModule = pModule;\r
-    }\r
-    CCodec_ModuleMgr*          GetCodecModule()\r
-    {\r
-        return m_pCodecModule;\r
-    }\r
-\r
-    void               InitPageModule();\r
-\r
-    void               InitRenderModule();\r
-\r
-\r
-    void               SetModulePath(FX_LPCSTR module_name, FX_LPCSTR path);\r
-\r
-    CFX_ByteString GetModuleFilePath(FX_LPCSTR module_name, FX_LPCSTR name);\r
-\r
-    void               SetDownloadCallback(FX_BOOL (*callback)(FX_LPCSTR module_name));\r
-\r
-    FX_BOOL            DownloadModule(FX_LPCSTR module_name);\r
-\r
-    void               NotifyModuleAvailable(FX_LPCSTR module_name);\r
-\r
-\r
-\r
-    CPDF_RenderModuleDef*      GetRenderModule() const\r
-    {\r
-        return m_pRenderModule;\r
-    }\r
-\r
-    CPDF_PageModuleDef*                GetPageModule() const\r
-    {\r
-        return m_pPageModule;\r
-    }\r
-\r
-\r
-\r
-\r
-    void                                       LoadEmbeddedGB1CMaps();\r
-\r
-    void                                       LoadEmbeddedCNS1CMaps();\r
-\r
-    void                                       LoadEmbeddedJapan1CMaps();\r
-\r
-    void                                       LoadEmbeddedKorea1CMaps();\r
-\r
-    ICodec_FaxModule*          GetFaxModule();\r
-    ICodec_JpegModule*         GetJpegModule();\r
-    ICodec_JpxModule*          GetJpxModule();\r
-    ICodec_Jbig2Module*                GetJbig2Module();\r
-    ICodec_IccModule*          GetIccModule();\r
-    ICodec_FlateModule*                GetFlateModule();\r
-\r
-    void                                       RegisterSecurityHandler(FX_LPCSTR name, CPDF_SecurityHandler * (*CreateHandler)(void* param), void* param);\r
-\r
-    CPDF_SecurityHandler*      CreateSecurityHandler(FX_LPCSTR name);\r
-\r
-    void                                       SetPrivateData(FX_LPVOID module_id, FX_LPVOID pData, PD_CALLBACK_FREEDATA callback);\r
-\r
-    FX_LPVOID                          GetPrivateData(FX_LPVOID module_id);\r
-\r
-    int                                                m_FileBufSize;\r
-protected:\r
-\r
-    CPDF_ModuleMgr();\r
-\r
-    ~CPDF_ModuleMgr();\r
-    void                                       Initialize();\r
-\r
-    void                                       InitModules();\r
-\r
-\r
-\r
-    CCodec_ModuleMgr*          m_pCodecModule;\r
-\r
-    CPDF_RenderModuleDef*      m_pRenderModule;\r
-\r
-    CPDF_PageModuleDef*                m_pPageModule;\r
-\r
-\r
-    FX_BOOL (*m_pDownloadCallback)(FX_LPCSTR module_name);\r
-\r
-    CFX_ByteString                     m_DefaultModulePath;\r
-\r
-    CFX_CMapByteStringToPtr    m_ModulePathList;\r
-\r
-    CFX_MapByteStringToPtr     m_SecurityHandlerMap;\r
-\r
-    CFX_PrivateData                    m_privateData;\r
-};\r
-class CPDF_Document;\r
-class CPDF_DocPageData;\r
-class CPDF_FontGlobals;\r
-class IPDF_FontMgr;\r
-class IPDF_FontMapper;\r
-class CPDF_ColorSpace;\r
-class CPDF_PageModuleDef : public CFX_Object\r
-{\r
-public:\r
-    virtual ~CPDF_PageModuleDef() {}\r
-\r
-    virtual CPDF_DocPageData*  CreateDocData(CPDF_Document* pDoc)\r
-    {\r
-        return NULL;\r
-    }\r
-\r
-    virtual void                               ReleaseDoc(CPDF_Document*) {}\r
-    virtual void                               ClearDoc(CPDF_Document*) {}\r
-\r
-    virtual CPDF_FontGlobals*  GetFontGlobals()\r
-    {\r
-        return NULL;\r
-    }\r
-\r
-    virtual void                               ClearStockFont(CPDF_Document* pDoc) {}\r
-\r
-    virtual void                               NotifyCJKAvailable() {}\r
-\r
-    virtual CPDF_ColorSpace*   GetStockCS(int family)\r
-    {\r
-        return NULL;\r
-    }\r
-};\r
-class CPDF_PageObjects;\r
-class CFX_AffineMatrix;\r
-class CPDF_RenderOptions;\r
-class CPDF_Page;\r
-class CPDF_DocRenderData;\r
-class CPDF_PageRenderCache;\r
-class CFX_BitmapDevice;\r
-class CPDF_Stream;\r
-class CFX_DIBSource;\r
-class CPDF_RenderConfig;\r
-class CPDF_Image;\r
-class CPDF_RenderModuleDef : public CFX_Object\r
-{\r
-public:\r
-    virtual ~CPDF_RenderModuleDef() {}\r
-\r
-    virtual CPDF_DocRenderData*        CreateDocData(CPDF_Document* pDoc)\r
-    {\r
-        return NULL;\r
-    }\r
-\r
-    virtual void       DestroyDocData(CPDF_DocRenderData*) {}\r
-    virtual void       ClearDocData(CPDF_DocRenderData*) {}\r
-\r
-    virtual CPDF_DocRenderData* GetRenderData()\r
-    {\r
-        return NULL;\r
-    }\r
-\r
-    virtual CPDF_PageRenderCache*      CreatePageCache(CPDF_Page* pPage)\r
-    {\r
-        return NULL;\r
-    }\r
-\r
-    virtual void       DestroyPageCache(CPDF_PageRenderCache*) {}\r
-\r
-    virtual void       NotifyDecoderAvailable() {}\r
-\r
-    virtual CPDF_RenderConfig* GetConfig()\r
-    {\r
-        return NULL;\r
-    }\r
-};\r
-#endif\r
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by 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
index e67144b..622f39d 100644 (file)
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#ifndef _FPDF_OBJECTS_\r
-#define _FPDF_OBJECTS_\r
-#ifndef _FXCRT_EXTENSION_\r
-#include "../fxcrt/fx_ext.h"\r
-#endif\r
-class CPDF_Document;\r
-class CPDF_IndirectObjects;\r
-class CPDF_Null;\r
-class CPDF_Boolean;\r
-class CPDF_Number;\r
-class CPDF_String;\r
-class CPDF_Stream;\r
-class CPDF_StreamAcc;\r
-class CPDF_StreamFilter;\r
-class CPDF_Array;\r
-class CPDF_Dictionary;\r
-class CPDF_Reference;\r
-class IPDF_DocParser;\r
-class IFX_FileRead;\r
-class CPDF_CryptoHandler;\r
-#define PDFOBJ_INVALID         0\r
-#define        PDFOBJ_BOOLEAN          1\r
-#define PDFOBJ_NUMBER          2\r
-#define PDFOBJ_STRING          3\r
-#define PDFOBJ_NAME                    4\r
-#define PDFOBJ_ARRAY           5\r
-#define PDFOBJ_DICTIONARY      6\r
-#define PDFOBJ_STREAM          7\r
-#define PDFOBJ_NULL                    8\r
-#define PDFOBJ_REFERENCE       9\r
-typedef IFX_FileStream* (*FPDF_LPFCloneStreamCallback)(CPDF_Stream *pStream, FX_LPVOID pUserData);\r
-class CPDF_Object : public CFX_Object\r
-{\r
-public:\r
-\r
-    int                                                GetType() const\r
-    {\r
-        return m_Type;\r
-    }\r
-\r
-    FX_DWORD                           GetObjNum() const\r
-    {\r
-        return m_ObjNum;\r
-    }\r
-\r
-    FX_BOOL                                    IsIdentical(CPDF_Object* pObj) const;\r
-\r
-    CPDF_Object*                       Clone(FX_BOOL bDirect = FALSE) const;\r
-\r
-    CPDF_Object*                       CloneRef(CPDF_IndirectObjects* pObjs) const;\r
-\r
-    CPDF_Object*                       GetDirect() const;\r
-\r
-    void                                       Release();\r
-\r
-    CFX_ByteString                     GetString() const;\r
-\r
-    CFX_ByteStringC                    GetConstString() const;\r
-\r
-    CFX_WideString                     GetUnicodeText(CFX_CharMap* pCharMap = NULL) const;\r
-\r
-    FX_FLOAT                           GetNumber() const;\r
-\r
-    FX_FLOAT                           GetNumber16() const;\r
-\r
-    int                                                GetInteger() const;\r
-\r
-    CPDF_Dictionary*           GetDict() const;\r
-\r
-    CPDF_Array*                                GetArray() const;\r
-\r
-    void                                       SetString(const CFX_ByteString& str);\r
-\r
-    void                                       SetUnicodeText(FX_LPCWSTR pUnicodes, int len = -1);\r
-\r
-    int                                                GetDirectType() const;\r
-\r
-    FX_BOOL                                    IsModified() const\r
-    {\r
-        return FALSE;\r
-    }\r
-protected:\r
-    FX_DWORD                           m_Type;\r
-    CPDF_Object()\r
-    {\r
-        m_ObjNum = 0;\r
-    }\r
-\r
-    FX_DWORD                           m_ObjNum;\r
-\r
-    void                                       Destroy();\r
-\r
-\r
-    ~CPDF_Object() {}\r
-    friend class                       CPDF_IndirectObjects;\r
-    friend class                       CPDF_Parser;\r
-    friend class                       CPDF_SyntaxParser;\r
-private:\r
-    CPDF_Object(const CPDF_Object& src) {}\r
-    CPDF_Object* CloneInternal(FX_BOOL bDirect, CFX_MapPtrToPtr* visited) const;\r
-};\r
-class CPDF_Boolean : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Boolean*       Create(FX_BOOL value)\r
-    {\r
-        return FX_NEW CPDF_Boolean(value);\r
-    }\r
-\r
-    CPDF_Boolean()\r
-    {\r
-        m_Type = PDFOBJ_BOOLEAN;\r
-    }\r
-\r
-    CPDF_Boolean(FX_BOOL value)\r
-    {\r
-        m_Type = PDFOBJ_BOOLEAN;\r
-        m_bValue = value;\r
-    }\r
-\r
-    FX_BOOL                                    Identical(CPDF_Boolean* pOther) const\r
-    {\r
-        return m_bValue == pOther->m_bValue;\r
-    }\r
-protected:\r
-\r
-    FX_BOOL                                    m_bValue;\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_Number : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Number*                Create(int value)\r
-    {\r
-        return FX_NEW CPDF_Number(value);\r
-    }\r
-\r
-    static CPDF_Number*                Create(FX_FLOAT value)\r
-    {\r
-        return FX_NEW CPDF_Number(value);\r
-    }\r
-\r
-    static CPDF_Number*                Create(FX_BSTR str)\r
-    {\r
-        return FX_NEW CPDF_Number(str);\r
-    }\r
-\r
-    static CPDF_Number*                Create(FX_BOOL bInteger, void* pData)\r
-    {\r
-        return FX_NEW CPDF_Number(bInteger, pData);\r
-    }\r
-\r
-    CPDF_Number()\r
-    {\r
-        m_Type = PDFOBJ_NUMBER;\r
-    }\r
-\r
-    CPDF_Number(FX_BOOL bInteger, void* pData);\r
-\r
-    CPDF_Number(int value);\r
-\r
-    CPDF_Number(FX_FLOAT value);\r
-\r
-    CPDF_Number(FX_BSTR str);\r
-\r
-    FX_BOOL                                    Identical(CPDF_Number* pOther) const;\r
-\r
-    CFX_ByteString                     GetString() const;\r
-\r
-    void                                       SetString(FX_BSTR str);\r
-\r
-    FX_BOOL                                    IsInteger() const\r
-    {\r
-        return m_bInteger;\r
-    }\r
-\r
-    int                                                GetInteger() const\r
-    {\r
-        return m_bInteger ? m_Integer : (int)m_Float;\r
-    }\r
-\r
-    FX_FLOAT                           GetNumber() const\r
-    {\r
-        return m_bInteger ? (FX_FLOAT)m_Integer : m_Float;\r
-    }\r
-\r
-    void                                       SetNumber(FX_FLOAT value);\r
-\r
-    FX_FLOAT                   GetNumber16() const\r
-    {\r
-        return GetNumber();\r
-    }\r
-\r
-    FX_FLOAT                           GetFloat() const\r
-    {\r
-        return m_bInteger ? (FX_FLOAT)m_Integer : m_Float;\r
-    }\r
-protected:\r
-\r
-    FX_BOOL                                    m_bInteger;\r
-\r
-    union {\r
-\r
-        int                                    m_Integer;\r
-\r
-        FX_FLOAT                       m_Float;\r
-    };\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_String : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_String*                Create(const CFX_ByteString& str, FX_BOOL bHex = FALSE)\r
-    {\r
-        return FX_NEW CPDF_String(str, bHex);\r
-    }\r
-\r
-    static CPDF_String*                Create(const CFX_WideString& str)\r
-    {\r
-        return FX_NEW CPDF_String(str);\r
-    }\r
-\r
-    CPDF_String()\r
-    {\r
-        m_Type = PDFOBJ_STRING;\r
-        m_bHex = FALSE;\r
-    }\r
-\r
-    CPDF_String(const CFX_ByteString& str, FX_BOOL bHex = FALSE) : m_String(str)\r
-    {\r
-        m_Type = PDFOBJ_STRING;\r
-        m_bHex = bHex;\r
-    }\r
-\r
-    CPDF_String(const CFX_WideString& str);\r
-\r
-    CFX_ByteString&                    GetString()\r
-    {\r
-        return m_String;\r
-    }\r
-\r
-    FX_BOOL                                    Identical(CPDF_String* pOther) const\r
-    {\r
-        return m_String == pOther->m_String;\r
-    }\r
-\r
-    FX_BOOL                                    IsHex() const\r
-    {\r
-        return m_bHex;\r
-    }\r
-protected:\r
-\r
-    CFX_ByteString                     m_String;\r
-\r
-    FX_BOOL                                    m_bHex;\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_Name : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Name*          Create(const CFX_ByteString& str)\r
-    {\r
-        return FX_NEW CPDF_Name(str);\r
-    }\r
-\r
-    static CPDF_Name*          Create(FX_BSTR str)\r
-    {\r
-        return FX_NEW CPDF_Name(str);\r
-    }\r
-\r
-    static CPDF_Name*          Create(FX_LPCSTR str)\r
-    {\r
-        return FX_NEW CPDF_Name(str);\r
-    }\r
-\r
-    CPDF_Name(const CFX_ByteString& str) : m_Name(str)\r
-    {\r
-        m_Type = PDFOBJ_NAME;\r
-    }\r
-\r
-    CPDF_Name(FX_BSTR str) : m_Name(str)\r
-    {\r
-        m_Type = PDFOBJ_NAME;\r
-    }\r
-\r
-    CPDF_Name(FX_LPCSTR str) : m_Name(str)\r
-    {\r
-        m_Type = PDFOBJ_NAME;\r
-    }\r
-\r
-    CFX_ByteString&                    GetString()\r
-    {\r
-        return m_Name;\r
-    }\r
-\r
-    FX_BOOL                                    Identical(CPDF_Name* pOther) const\r
-    {\r
-        return m_Name == pOther->m_Name;\r
-    }\r
-protected:\r
-\r
-    CFX_ByteString                     m_Name;\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_Array : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Array*         Create()\r
-    {\r
-        return FX_NEW CPDF_Array();\r
-    }\r
-\r
-    CPDF_Array()\r
-    {\r
-        m_Type = PDFOBJ_ARRAY;\r
-    }\r
-\r
-    FX_DWORD                           GetCount() const\r
-    {\r
-        return m_Objects.GetSize();\r
-    }\r
-\r
-    CPDF_Object*                       GetElement(FX_DWORD index) const;\r
-\r
-    CPDF_Object*                       GetElementValue(FX_DWORD index) const;\r
-\r
-\r
-\r
-    CFX_AffineMatrix           GetMatrix();\r
-\r
-    CFX_FloatRect                      GetRect();\r
-\r
-\r
-\r
-\r
-    CFX_ByteString                     GetString(FX_DWORD index) const;\r
-\r
-    CFX_ByteStringC                    GetConstString(FX_DWORD index) const;\r
-\r
-    int                                                GetInteger(FX_DWORD index) const;\r
-\r
-    FX_FLOAT                           GetNumber(FX_DWORD index) const;\r
-\r
-    CPDF_Dictionary*           GetDict(FX_DWORD index) const;\r
-\r
-    CPDF_Stream*                       GetStream(FX_DWORD index) const;\r
-\r
-    CPDF_Array*                                GetArray(FX_DWORD index) const;\r
-\r
-    FX_FLOAT                           GetFloat(FX_DWORD index) const\r
-    {\r
-        return GetNumber(index);\r
-    }\r
-\r
-\r
-\r
-\r
-    void                                       SetAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);\r
-\r
-\r
-    void                                       InsertAt(FX_DWORD index, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);\r
-\r
-    void                                       RemoveAt(FX_DWORD index);\r
-\r
-\r
-    void                                       Add(CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);\r
-\r
-\r
-\r
-    void                                       AddNumber(FX_FLOAT f);\r
-\r
-    void                                       AddInteger(int i);\r
-\r
-    void                                       AddString(const CFX_ByteString& str);\r
-\r
-    void                                       AddName(const CFX_ByteString& str);\r
-\r
-    void                                       AddReference(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);\r
-\r
-    void                                       AddReference(CPDF_IndirectObjects* pDoc, CPDF_Object* obj)\r
-    {\r
-        AddReference(pDoc, obj->GetObjNum());\r
-    }\r
-\r
-\r
-    FX_FLOAT                   GetNumber16(FX_DWORD index) const\r
-    {\r
-        return GetNumber(index);\r
-    }\r
-\r
-    void                                       AddNumber16(FX_FLOAT value)\r
-    {\r
-        AddNumber(value);\r
-    }\r
-\r
-    FX_BOOL                                    Identical(CPDF_Array* pOther) const;\r
-protected:\r
-\r
-    ~CPDF_Array();\r
-\r
-    CFX_PtrArray                       m_Objects;\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_Dictionary : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Dictionary*    Create()\r
-    {\r
-        return FX_NEW CPDF_Dictionary();\r
-    }\r
-\r
-    CPDF_Dictionary()\r
-    {\r
-        m_Type = PDFOBJ_DICTIONARY;\r
-    }\r
-\r
-\r
-\r
-    CPDF_Object*                       GetElement(FX_BSTR key) const;\r
-\r
-    CPDF_Object*                       GetElementValue(FX_BSTR key) const;\r
-\r
-\r
-\r
-\r
-\r
-    CFX_ByteString                     GetString(FX_BSTR key) const;\r
-\r
-    CFX_ByteStringC                    GetConstString(FX_BSTR key) const;\r
-\r
-    CFX_ByteString                     GetString(FX_BSTR key, FX_BSTR default_str) const;\r
-\r
-    CFX_ByteStringC                    GetConstString(FX_BSTR key, FX_BSTR default_str) const;\r
-\r
-    CFX_WideString                     GetUnicodeText(FX_BSTR key, CFX_CharMap* pCharMap = NULL) const;\r
-\r
-    int                                                GetInteger(FX_BSTR key) const;\r
-\r
-    int                                                GetInteger(FX_BSTR key, int default_int) const;\r
-\r
-    FX_BOOL                                    GetBoolean(FX_BSTR key, FX_BOOL bDefault = FALSE) const;\r
-\r
-    FX_FLOAT                           GetNumber(FX_BSTR key) const;\r
-\r
-    CPDF_Dictionary*           GetDict(FX_BSTR key) const;\r
-\r
-    CPDF_Stream*                       GetStream(FX_BSTR key) const;\r
-\r
-    CPDF_Array*                                GetArray(FX_BSTR key) const;\r
-\r
-    CFX_FloatRect                      GetRect(FX_BSTR key) const;\r
-\r
-    CFX_AffineMatrix           GetMatrix(FX_BSTR key) const;\r
-\r
-    FX_FLOAT                           GetFloat(FX_BSTR key) const\r
-    {\r
-        return GetNumber(key);\r
-    }\r
-\r
-\r
-    FX_BOOL                                    KeyExist(FX_BSTR key) const;\r
-\r
-    FX_POSITION                                GetStartPos() const;\r
-\r
-    CPDF_Object*                       GetNextElement(FX_POSITION& pos, CFX_ByteString& key) const;\r
-\r
-    void                                       SetAt(FX_BSTR key, CPDF_Object* pObj, CPDF_IndirectObjects* pObjs = NULL);\r
-\r
-\r
-\r
-    void                                       SetAtName(FX_BSTR key, const CFX_ByteString& name);\r
-\r
-\r
-    void                                       SetAtString(FX_BSTR key, const CFX_ByteString& string);\r
-\r
-\r
-    void                                       SetAtInteger(FX_BSTR key, int i);\r
-\r
-\r
-    void                                       SetAtNumber(FX_BSTR key, FX_FLOAT f);\r
-\r
-    void                                       SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum);\r
-\r
-    void                                       SetAtReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, CPDF_Object* obj)\r
-    {\r
-        SetAtReference(key, pDoc, obj->GetObjNum());\r
-    }\r
-\r
-    void                                       AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, FX_DWORD objnum);\r
-\r
-    void                                       AddReference(FX_BSTR key, CPDF_IndirectObjects* pDoc, CPDF_Object* obj)\r
-    {\r
-        AddReference(key, pDoc, obj->GetObjNum());\r
-    }\r
-\r
-    void                                       SetAtRect(FX_BSTR key, const CFX_FloatRect& rect);\r
-\r
-    void                                       SetAtMatrix(FX_BSTR key, const CFX_AffineMatrix& matrix);\r
-\r
-    void                                       SetAtBoolean(FX_BSTR key, FX_BOOL bValue);\r
-\r
-\r
-\r
-    void                                       RemoveAt(FX_BSTR key);\r
-\r
-\r
-    void                                       ReplaceKey(FX_BSTR oldkey, FX_BSTR newkey);\r
-\r
-    FX_BOOL                                    Identical(CPDF_Dictionary* pDict) const;\r
-\r
-    int                                                GetCount() const\r
-    {\r
-        return m_Map.GetCount();\r
-    }\r
-\r
-    void                                       AddValue(FX_BSTR key, CPDF_Object* pObj);\r
-protected:\r
-\r
-    ~CPDF_Dictionary();\r
-\r
-    CFX_CMapByteStringToPtr    m_Map;\r
-\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_Stream : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Stream*                Create(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict)\r
-    {\r
-        return FX_NEW CPDF_Stream(pData, size, pDict);\r
-    }\r
-\r
-    CPDF_Stream(FX_LPBYTE pData, FX_DWORD size, CPDF_Dictionary* pDict);\r
-\r
-    CPDF_Dictionary*           GetDict() const\r
-    {\r
-        return m_pDict;\r
-    }\r
-\r
-    void                                       SetData(FX_LPCBYTE pData, FX_DWORD size, FX_BOOL bCompressed, FX_BOOL bKeepBuf);\r
-\r
-    void                                       InitStream(FX_BYTE* pData, FX_DWORD size, CPDF_Dictionary* pDict);\r
-\r
-    void                                       InitStream(IFX_FileRead *pFile, CPDF_Dictionary* pDict);\r
-\r
-    FX_BOOL                                    Identical(CPDF_Stream* pOther) const;\r
-\r
-    CPDF_StreamFilter*         GetStreamFilter(FX_BOOL bRaw = FALSE) const;\r
-\r
-\r
-\r
-    FX_DWORD                           GetRawSize() const\r
-    {\r
-        return m_dwSize;\r
-    }\r
-\r
-    FX_BOOL                                    ReadRawData(FX_FILESIZE start_pos, FX_LPBYTE pBuf, FX_DWORD buf_size) const;\r
-\r
-\r
-    FX_BOOL                                    IsMemoryBased() const\r
-    {\r
-        return m_GenNum == (FX_DWORD) - 1;\r
-    }\r
-\r
-    CPDF_Stream*                       Clone(FX_BOOL bDirect, FPDF_LPFCloneStreamCallback lpfCallback, FX_LPVOID pUserData) const;\r
-protected:\r
-\r
-    ~CPDF_Stream();\r
-\r
-    CPDF_Dictionary*           m_pDict;\r
-\r
-    FX_DWORD                           m_dwSize;\r
-\r
-    FX_DWORD                           m_GenNum;\r
-\r
-    union {\r
-\r
-        FX_LPBYTE                      m_pDataBuf;\r
-\r
-        IFX_FileRead*          m_pFile;\r
-    };\r
-\r
-    FX_FILESIZE                                m_FileOffset;\r
-\r
-    CPDF_CryptoHandler*                m_pCryptoHandler;\r
-\r
-    void                                       InitStream(CPDF_Dictionary* pDict);\r
-    friend class                       CPDF_Object;\r
-    friend class                       CPDF_StreamAcc;\r
-    friend class                       CPDF_AttachmentAcc;\r
-};\r
-class CPDF_StreamAcc : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_StreamAcc();\r
-\r
-    ~CPDF_StreamAcc();\r
-\r
-    void                                       LoadAllData(const CPDF_Stream* pStream, FX_BOOL bRawAccess = FALSE,\r
-                                        FX_DWORD estimated_size = 0, FX_BOOL bImageAcc = FALSE);\r
-\r
-    const CPDF_Stream*         GetStream() const\r
-    {\r
-        return m_pStream;\r
-    }\r
-\r
-    CPDF_Dictionary*           GetDict() const\r
-    {\r
-        return m_pStream->GetDict();\r
-    }\r
-\r
-    FX_LPCBYTE                         GetData() const;\r
-\r
-    FX_DWORD                           GetSize() const;\r
-\r
-    FX_LPBYTE                          DetachData();\r
-\r
-    const CFX_ByteString&      GetImageDecoder()\r
-    {\r
-        return m_ImageDecoder;\r
-    }\r
-\r
-    const CPDF_Dictionary*     GetImageParam()\r
-    {\r
-        return m_pImageParam;\r
-    }\r
-protected:\r
-\r
-    FX_LPBYTE                          m_pData;\r
-\r
-    FX_DWORD                           m_dwSize;\r
-\r
-    FX_BOOL                                    m_bNewBuf;\r
-\r
-    CFX_ByteString                     m_ImageDecoder;\r
-\r
-    CPDF_Dictionary*           m_pImageParam;\r
-\r
-    const CPDF_Stream*         m_pStream;\r
-\r
-    FX_LPBYTE                          m_pSrcData;\r
-};\r
-CFX_DataFilter* FPDF_CreateFilter(FX_BSTR name, const CPDF_Dictionary* pParam, int width = 0, int height = 0);\r
-#define FPDF_FILTER_BUFFER_SIZE                20480\r
-class CPDF_StreamFilter : public CFX_Object\r
-{\r
-public:\r
-\r
-    ~CPDF_StreamFilter();\r
-\r
-    FX_DWORD                   ReadBlock(FX_LPBYTE buffer, FX_DWORD size);\r
-\r
-    FX_DWORD                   GetSrcPos()\r
-    {\r
-        return m_SrcOffset;\r
-    }\r
-\r
-    const CPDF_Stream* GetStream()\r
-    {\r
-        return m_pStream;\r
-    }\r
-protected:\r
-\r
-    CPDF_StreamFilter() {}\r
-\r
-    FX_DWORD                   ReadLeftOver(FX_LPBYTE buffer, FX_DWORD buf_size);\r
-\r
-    const CPDF_Stream* m_pStream;\r
-\r
-    CFX_DataFilter*            m_pFilter;\r
-\r
-    CFX_BinaryBuf*             m_pBuffer;\r
-\r
-    FX_DWORD                   m_BufOffset;\r
-\r
-    FX_DWORD                   m_SrcOffset;\r
-\r
-    FX_BYTE                            m_SrcBuffer[FPDF_FILTER_BUFFER_SIZE];\r
-    friend class CPDF_Stream;\r
-};\r
-class CPDF_Null : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Null*          Create()\r
-    {\r
-        return FX_NEW CPDF_Null();\r
-    }\r
-\r
-    CPDF_Null()\r
-    {\r
-        m_Type = PDFOBJ_NULL;\r
-    }\r
-};\r
-class CPDF_Reference : public CPDF_Object\r
-{\r
-public:\r
-\r
-    static CPDF_Reference*     Create(CPDF_IndirectObjects* pDoc, int objnum)\r
-    {\r
-        return FX_NEW CPDF_Reference(pDoc, objnum);\r
-    }\r
-\r
-    CPDF_Reference(CPDF_IndirectObjects* pDoc, int objnum)\r
-    {\r
-        m_Type = PDFOBJ_REFERENCE;\r
-        m_pObjList = pDoc;\r
-        m_RefObjNum = objnum;\r
-    }\r
-\r
-    CPDF_IndirectObjects*      GetObjList() const\r
-    {\r
-        return m_pObjList;\r
-    }\r
-\r
-    FX_DWORD                           GetRefObjNum() const\r
-    {\r
-        return m_RefObjNum;\r
-    }\r
-\r
-    void                                       SetRef(CPDF_IndirectObjects* pDoc, FX_DWORD objnum);\r
-\r
-    FX_BOOL                                    Identical(CPDF_Reference* pOther) const\r
-    {\r
-        return m_RefObjNum == pOther->m_RefObjNum;\r
-    }\r
-protected:\r
-\r
-    CPDF_IndirectObjects*      m_pObjList;\r
-\r
-    FX_DWORD                           m_RefObjNum;\r
-    friend class                       CPDF_Object;\r
-};\r
-class CPDF_IndirectObjects : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_IndirectObjects(IPDF_DocParser* pParser);\r
-\r
-    ~CPDF_IndirectObjects();\r
-\r
-    CPDF_Object*                       GetIndirectObject(FX_DWORD objnum, struct PARSE_CONTEXT* pContext = NULL);\r
-\r
-    int                                                GetIndirectType(FX_DWORD objnum);\r
-\r
-    FX_DWORD                           AddIndirectObject(CPDF_Object* pObj);\r
-\r
-    void                                       ReleaseIndirectObject(FX_DWORD objnum);\r
-\r
-    void                                       InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj);\r
-\r
-    FX_DWORD                           GetLastObjNum() const;\r
-\r
-    FX_POSITION                                GetStartPosition() const\r
-    {\r
-        return m_IndirectObjs.GetStartPosition();\r
-    }\r
-\r
-    void                                       GetNextAssoc(FX_POSITION& rPos, FX_DWORD& objnum, CPDF_Object*& pObject) const\r
-    {\r
-        m_IndirectObjs.GetNextAssoc(rPos, (void*&)objnum, (void*&)pObject);\r
-    }\r
-protected:\r
-\r
-    CFX_MapPtrToPtr                    m_IndirectObjs;\r
-\r
-    IPDF_DocParser*                    m_pParser;\r
-\r
-    FX_DWORD                           m_LastObjNum;\r
-};\r
-#endif\r
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by 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
index 29b8c68..3fea866 100644 (file)
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#ifndef _FPDF_PAGE_\r
-#define _FPDF_PAGE_\r
-#ifndef _FPDF_PARSER_\r
-#include "fpdf_parser.h"\r
-#endif\r
-#ifndef _FPDF_RESOURCE_\r
-#include "fpdf_resource.h"\r
-#endif\r
-#ifndef _FX_DIB_H_\r
-#include "../fxge/fx_dib.h"\r
-#endif\r
-class CPDF_PageObjects;\r
-class CPDF_Page;\r
-class CPDF_Form;\r
-class CPDF_ParseOptions;\r
-class CPDF_PageObject;\r
-class CPDF_PageRenderCache;\r
-class CPDF_StreamFilter;\r
-class CPDF_AllStates;\r
-class CPDF_ContentParser;\r
-class CPDF_StreamContentParser;\r
-class CPDF_ResourceNaming;\r
-#define PDFTRANS_GROUP                 0x0100\r
-#define PDFTRANS_ISOLATED              0x0200\r
-#define PDFTRANS_KNOCKOUT              0x0400\r
-#define PDF_CONTENT_NOT_PARSED 0\r
-#define PDF_CONTENT_PARSING            1\r
-#define PDF_CONTENT_PARSED             2\r
-class CPDF_PageObjects : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_PageObjects(FX_BOOL bReleaseMembers = TRUE);\r
-\r
-    ~CPDF_PageObjects();\r
-\r
-\r
-\r
-\r
-    void                               ContinueParse(IFX_Pause* pPause);\r
-\r
-    int                                        GetParseState() const\r
-    {\r
-        return m_ParseState;\r
-    }\r
-\r
-    FX_BOOL                            IsParsed() const\r
-    {\r
-        return m_ParseState == PDF_CONTENT_PARSED;\r
-    }\r
-\r
-    int                                        EstimateParseProgress() const;\r
-\r
-\r
-\r
-\r
-    FX_POSITION                        GetFirstObjectPosition() const\r
-    {\r
-        return m_ObjectList.GetHeadPosition();\r
-    }\r
-\r
-    FX_POSITION                        GetLastObjectPosition() const\r
-    {\r
-        return m_ObjectList.GetTailPosition();\r
-    }\r
-\r
-    CPDF_PageObject*   GetNextObject(FX_POSITION& pos) const\r
-    {\r
-        return (CPDF_PageObject*)m_ObjectList.GetNext(pos);\r
-    }\r
-\r
-    CPDF_PageObject*   GetPrevObject(FX_POSITION& pos) const\r
-    {\r
-        return (CPDF_PageObject*)m_ObjectList.GetPrev(pos);\r
-    }\r
-\r
-    CPDF_PageObject*   GetObjectAt(FX_POSITION pos) const\r
-    {\r
-        return (CPDF_PageObject*)m_ObjectList.GetAt(pos);\r
-    }\r
-\r
-    FX_DWORD                   CountObjects() const\r
-    {\r
-        return m_ObjectList.GetCount();\r
-    }\r
-\r
-    int                                        GetObjectIndex(CPDF_PageObject* pObj) const;\r
-\r
-    CPDF_PageObject*   GetObjectByIndex(int index) const;\r
-\r
-\r
-\r
-\r
-\r
-    FX_POSITION                        InsertObject(FX_POSITION posInsertAfter, CPDF_PageObject* pNewObject);\r
-\r
-    void                               Transform(const CFX_AffineMatrix& matrix);\r
-\r
-    FX_BOOL                            BackgroundAlphaNeeded() const\r
-    {\r
-        return m_bBackgroundAlphaNeeded;\r
-    }\r
-\r
-    CFX_FloatRect              CalcBoundingBox() const;\r
-\r
-    CPDF_Dictionary*   m_pFormDict;\r
-\r
-    CPDF_Stream*               m_pFormStream;\r
-\r
-    CPDF_Document*             m_pDocument;\r
-\r
-    CPDF_Dictionary*   m_pPageResources;\r
-\r
-    CPDF_Dictionary*   m_pResources;\r
-\r
-    CFX_FloatRect              m_BBox;\r
-\r
-    int                                        m_Transparency;\r
-\r
-protected:\r
-    friend class               CPDF_ContentParser;\r
-    friend class               CPDF_StreamContentParser;\r
-    friend class               CPDF_AllStates;\r
-\r
-    CFX_PtrList                        m_ObjectList;\r
-\r
-    FX_BOOL                            m_bBackgroundAlphaNeeded;\r
-\r
-    FX_BOOL                            m_bReleaseMembers;\r
-    void                               LoadTransInfo();\r
-    void                ClearCacheObjects();\r
-\r
-    CPDF_ContentParser*        m_pParser;\r
-\r
-    FX_BOOL                            m_ParseState;\r
-};\r
-class CPDF_Page : public CPDF_PageObjects, public CFX_PrivateData\r
-{\r
-public:\r
-\r
-    CPDF_Page();\r
-\r
-    ~CPDF_Page();\r
-\r
-    void                               Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BOOL bPageCache = TRUE);\r
-\r
-    void                               StartParse(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);\r
-\r
-    void                               ParseContent(CPDF_ParseOptions* pOptions = NULL, FX_BOOL bReParse = FALSE);\r
-\r
-    void                               GetDisplayMatrix(CFX_AffineMatrix& matrix, int xPos, int yPos,\r
-                                         int xSize, int ySize, int iRotate) const;\r
-\r
-    FX_FLOAT                   GetPageWidth() const\r
-    {\r
-        return m_PageWidth;\r
-    }\r
-\r
-    FX_FLOAT                   GetPageHeight() const\r
-    {\r
-        return m_PageHeight;\r
-    }\r
-\r
-    CFX_FloatRect              GetPageBBox() const\r
-    {\r
-        return m_BBox;\r
-    }\r
-\r
-    const CFX_AffineMatrix&    GetPageMatrix() const\r
-    {\r
-        return m_PageMatrix;\r
-    }\r
-\r
-    CPDF_Object*               GetPageAttr(FX_BSTR name) const;\r
-\r
-\r
-\r
-    CPDF_PageRenderCache*      GetRenderCache() const\r
-    {\r
-        return m_pPageRender;\r
-    }\r
-\r
-    void                               ClearRenderCache();\r
-\r
-protected:\r
-    friend class               CPDF_ContentParser;\r
-\r
-    FX_FLOAT                   m_PageWidth;\r
-\r
-    FX_FLOAT                   m_PageHeight;\r
-\r
-    CFX_AffineMatrix   m_PageMatrix;\r
-\r
-    CPDF_PageRenderCache*      m_pPageRender;\r
-};\r
-class CPDF_ParseOptions : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_ParseOptions();\r
-\r
-    FX_BOOL                            m_bTextOnly;\r
-\r
-    FX_BOOL                            m_bMarkedContent;\r
-\r
-    FX_BOOL                            m_bSeparateForm;\r
-\r
-    FX_BOOL                            m_bDecodeInlineImage;\r
-};\r
-class CPDF_Form : public CPDF_PageObjects\r
-{\r
-public:\r
-\r
-    CPDF_Form(CPDF_Document* pDocument, CPDF_Dictionary* pPageResources, CPDF_Stream* pFormStream, CPDF_Dictionary* pParentResources = NULL);\r
-\r
-    ~CPDF_Form();\r
-\r
-    void                               StartParse(CPDF_AllStates* pGraphicStates,  CFX_AffineMatrix* pParentMatrix,\r
-                                   CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level = 0);\r
-\r
-    void                               ParseContent(CPDF_AllStates* pGraphicStates, CFX_AffineMatrix* pParentMatrix,\r
-                                     CPDF_Type3Char* pType3Char, CPDF_ParseOptions* pOptions, int level = 0);\r
-\r
-    CPDF_Form*                 Clone() const;\r
-};\r
-class CPDF_PageContentGenerate : public CFX_Object\r
-{\r
-public:\r
-    CPDF_PageContentGenerate(CPDF_Page* pPage);\r
-    ~CPDF_PageContentGenerate();\r
-    FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject);\r
-    void GenerateContent();\r
-    void TransformContent(CFX_Matrix& matrix);\r
-protected:\r
-    void            ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj);\r
-    void            ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix);\r
-    CFX_ByteString  RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType);\r
-private:\r
-    CPDF_Page*      m_pPage;\r
-    CPDF_Document*  m_pDocument;\r
-    CFX_PtrArray    m_pageObjects;\r
-};\r
-#endif\r
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by 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
index 1e82680..90e1b0b 100644 (file)
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#ifndef _FPDF_PAGEOBJ_H_\r
-#define _FPDF_PAGEOBJ_H_\r
-#ifndef _FPDF_RESOURCE_\r
-#include "fpdf_resource.h"\r
-#endif\r
-#ifndef _FX_GE_H_\r
-#include "../fxge/fx_ge.h"\r
-#endif\r
-class CPDF_Path;\r
-class CPDF_ClipPathData;\r
-class CPDF_ClipPath;\r
-class CPDF_ColorStateData;\r
-class CPDF_ColorState;\r
-class CPDF_GraphState;\r
-class CPDF_TextStateData;\r
-class CPDF_TextState;\r
-class CPDF_GeneralStateData;\r
-class CPDF_GeneralState;\r
-class CPDF_ContentMarkItem;\r
-class CPDF_ContentMark;\r
-class CPDF_GraphicStates;\r
-class CPDF_PageObject;\r
-class CPDF_TextObject;\r
-class CPDF_PathObject;\r
-class CPDF_ImageObject;\r
-class CPDF_ShadingObject;\r
-class CPDF_FormObject;\r
-class CPDF_InlineImages;\r
-typedef CFX_PathData CPDF_PathData;\r
-class CPDF_Path : public CFX_CountRef<CFX_PathData>\r
-{\r
-public:\r
-\r
-\r
-\r
-\r
-    int                                        GetPointCount()\r
-    {\r
-        return m_pObject->m_PointCount;\r
-    }\r
-\r
-    int                                        GetFlag(int index)\r
-    {\r
-        return m_pObject->m_pPoints[index].m_Flag;\r
-    }\r
-\r
-    FX_FLOAT                   GetPointX(int index)\r
-    {\r
-        return m_pObject->m_pPoints[index].m_PointX;\r
-    }\r
-\r
-    FX_FLOAT                   GetPointY(int index)\r
-    {\r
-        return m_pObject->m_pPoints[index].m_PointY;\r
-    }\r
-\r
-\r
-\r
-\r
-    FX_PATHPOINT*              GetPoints()\r
-    {\r
-        return m_pObject->m_pPoints;\r
-    }\r
-\r
-\r
-    CFX_FloatRect              GetBoundingBox() const\r
-    {\r
-        return m_pObject->GetBoundingBox();\r
-    }\r
-\r
-    CFX_FloatRect              GetBoundingBox(FX_FLOAT line_width, FX_FLOAT miter_limit) const\r
-    {\r
-        return m_pObject->GetBoundingBox(line_width, miter_limit);\r
-    }\r
-\r
-    void                               Transform(const CFX_AffineMatrix* pMatrix)\r
-    {\r
-        GetModify()->Transform(pMatrix);\r
-    }\r
-\r
-    void                               Append(CPDF_Path src, const CFX_AffineMatrix* pMatrix)\r
-    {\r
-        m_pObject->Append(src.m_pObject, pMatrix);\r
-    }\r
-\r
-    void                               AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top)\r
-    {\r
-        m_pObject->AppendRect(left, bottom, right, top);\r
-    }\r
-\r
-    FX_BOOL                            IsRect() const\r
-    {\r
-        return m_pObject->IsRect();\r
-    }\r
-};\r
-class CPDF_ClipPathData : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_ClipPathData();\r
-\r
-    CPDF_ClipPathData(const CPDF_ClipPathData&);\r
-\r
-    ~CPDF_ClipPathData();\r
-\r
-    void                               SetCount(int path_count, int text_count);\r
-public:\r
-\r
-    int                                        m_PathCount;\r
-\r
-    CPDF_Path*                 m_pPathList;\r
-\r
-    FX_BYTE*                   m_pTypeList;\r
-\r
-    int                                        m_TextCount;\r
-\r
-    CPDF_TextObject**  m_pTextList;\r
-};\r
-class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData>\r
-{\r
-public:\r
-\r
-    FX_DWORD                   GetPathCount() const\r
-    {\r
-        return m_pObject->m_PathCount;\r
-    }\r
-\r
-    CPDF_Path                  GetPath(int i) const\r
-    {\r
-        return m_pObject->m_pPathList[i];\r
-    }\r
-\r
-    int                                        GetClipType(int i) const\r
-    {\r
-        return m_pObject->m_pTypeList[i];\r
-    }\r
-\r
-    FX_DWORD                   GetTextCount() const\r
-    {\r
-        return m_pObject->m_TextCount;\r
-    }\r
-\r
-    CPDF_TextObject*   GetText(int i) const\r
-    {\r
-        return m_pObject->m_pTextList[i];\r
-    }\r
-\r
-    CFX_FloatRect              GetClipBox() const;\r
-\r
-    void                               AppendPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);\r
-\r
-    void                               DeletePath(int layer_index);\r
-\r
-    void                               AppendTexts(CPDF_TextObject** pTexts, int count);\r
-\r
-    void                               Transform(const CFX_AffineMatrix& matrix);\r
-};\r
-class CPDF_ColorStateData : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_ColorStateData() {}\r
-\r
-    CPDF_ColorStateData(const CPDF_ColorStateData& src);\r
-\r
-    void                               Default();\r
-\r
-    CPDF_Color                 m_FillColor;\r
-\r
-    FX_DWORD                   m_FillRGB;\r
-\r
-    CPDF_Color                 m_StrokeColor;\r
-\r
-    FX_DWORD                   m_StrokeRGB;\r
-};\r
-class CPDF_ColorState : public CFX_CountRef<CPDF_ColorStateData>\r
-{\r
-public:\r
-\r
-    CPDF_Color*                        GetFillColor() const\r
-    {\r
-        return m_pObject ? &m_pObject->m_FillColor : NULL;\r
-    }\r
-\r
-    CPDF_Color*                        GetStrokeColor() const\r
-    {\r
-        return m_pObject ? &m_pObject->m_StrokeColor : NULL;\r
-    }\r
-\r
-    void                               SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);\r
-\r
-    void                               SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);\r
-\r
-    void                               SetFillPattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues);\r
-\r
-    void                               SetStrokePattern(CPDF_Pattern* pattern, FX_FLOAT* pValue, int nValues);\r
-private:\r
-    void                               SetColor(CPDF_Color& color, FX_DWORD& rgb, CPDF_ColorSpace* pCS, FX_FLOAT* pValue, int nValues);\r
-};\r
-typedef CFX_GraphStateData CPDF_GraphStateData;\r
-class CPDF_GraphState : public CFX_CountRef<CFX_GraphStateData>\r
-{\r
-public:\r
-};\r
-class CPDF_TextStateData : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_TextStateData();\r
-\r
-    CPDF_TextStateData(const CPDF_TextStateData& src);\r
-\r
-    ~CPDF_TextStateData();\r
-\r
-    CPDF_Font*                 m_pFont;\r
-\r
-    FX_FLOAT                   m_FontSize;\r
-\r
-    FX_FLOAT                   m_CharSpace;\r
-\r
-    FX_FLOAT                   m_WordSpace;\r
-\r
-    FX_FLOAT           m_Matrix[4];\r
-\r
-    int                                        m_TextMode;\r
-\r
-    FX_FLOAT           m_CTM[4];\r
-};\r
-class CPDF_TextState : public CFX_CountRef<CPDF_TextStateData>\r
-{\r
-public:\r
-\r
-    CPDF_Font*                 GetFont() const\r
-    {\r
-        return m_pObject->m_pFont;\r
-    }\r
-\r
-    void                               SetFont(CPDF_Font* pFont);\r
-\r
-    FX_FLOAT                   GetFontSize() const\r
-    {\r
-        return m_pObject->m_FontSize;\r
-    }\r
-\r
-    FX_FLOAT*                  GetMatrix() const\r
-    {\r
-        return m_pObject->m_Matrix;\r
-    }\r
-\r
-\r
-\r
-    FX_FLOAT                   GetFontSizeV() const;\r
-\r
-    FX_FLOAT                   GetFontSizeH() const;\r
-\r
-    FX_FLOAT                   GetBaselineAngle() const;\r
-\r
-    FX_FLOAT                   GetShearAngle() const;\r
-\r
-};\r
-class CPDF_TransferFunc;\r
-class CPDF_GeneralStateData : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_GeneralStateData();\r
-\r
-    CPDF_GeneralStateData(const CPDF_GeneralStateData& src);\r
-    ~CPDF_GeneralStateData();\r
-\r
-    void                               SetBlendMode(FX_BSTR blend_mode);\r
-\r
-    char                               m_BlendMode[16];\r
-\r
-    int                                        m_BlendType;\r
-\r
-    CPDF_Object*               m_pSoftMask;\r
-\r
-    FX_FLOAT                   m_SMaskMatrix[6];\r
-\r
-    FX_FLOAT                   m_StrokeAlpha;\r
-\r
-    FX_FLOAT                   m_FillAlpha;\r
-\r
-    CPDF_Object*               m_pTR;\r
-\r
-    CPDF_TransferFunc* m_pTransferFunc;\r
-\r
-    CFX_Matrix                 m_Matrix;\r
-\r
-    int                                        m_RenderIntent;\r
-\r
-    FX_BOOL                            m_StrokeAdjust;\r
-\r
-    FX_BOOL                            m_AlphaSource;\r
-\r
-    FX_BOOL                            m_TextKnockout;\r
-\r
-    FX_BOOL                            m_StrokeOP;\r
-\r
-    FX_BOOL                            m_FillOP;\r
-\r
-    int                                        m_OPMode;\r
-\r
-    CPDF_Object*               m_pBG;\r
-\r
-    CPDF_Object*               m_pUCR;\r
-\r
-    CPDF_Object*               m_pHT;\r
-\r
-    FX_FLOAT                   m_Flatness;\r
-\r
-    FX_FLOAT                   m_Smoothness;\r
-};\r
-class CPDF_GeneralState : public CFX_CountRef<CPDF_GeneralStateData>\r
-{\r
-public:\r
-\r
-    void                               SetRenderIntent(const CFX_ByteString& ri);\r
-\r
-    int                                        GetBlendType() const\r
-    {\r
-        return m_pObject ? m_pObject->m_BlendType : FXDIB_BLEND_NORMAL;\r
-    }\r
-\r
-    int                                        GetAlpha(FX_BOOL bStroke) const\r
-    {\r
-        return m_pObject ? FXSYS_round((bStroke ? m_pObject->m_StrokeAlpha : m_pObject->m_FillAlpha) * 255) : 255;\r
-    }\r
-};\r
-class CPDF_ContentMarkItem : public CFX_Object\r
-{\r
-public:\r
-\r
-    typedef enum {\r
-        None,\r
-        PropertiesDict,\r
-        DirectDict,\r
-        MCID\r
-    } ParamType;\r
-\r
-    CPDF_ContentMarkItem();\r
-\r
-    CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src);\r
-\r
-    ~CPDF_ContentMarkItem();\r
-\r
-    inline const CFX_ByteString&       GetName() const\r
-    {\r
-        return m_MarkName;\r
-    }\r
-\r
-    inline ParamType   GetParamType() const\r
-    {\r
-        return m_ParamType;\r
-    }\r
-\r
-    inline void*               GetParam() const\r
-    {\r
-        return m_pParam;\r
-    }\r
-\r
-    inline FX_BOOL             HasMCID() const;\r
-\r
-    inline void                        SetName(const CFX_ByteString& name)\r
-    {\r
-        m_MarkName = name;\r
-    }\r
-\r
-    inline void                        SetParam(ParamType type, void* param)\r
-    {\r
-        m_ParamType = type;\r
-        m_pParam = param;\r
-    }\r
-private:\r
-\r
-    CFX_ByteString             m_MarkName;\r
-\r
-    ParamType                  m_ParamType;\r
-\r
-    void*                              m_pParam;\r
-};\r
-class CPDF_ContentMarkData : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_ContentMarkData() { }\r
-\r
-    CPDF_ContentMarkData(const CPDF_ContentMarkData& src);\r
-\r
-    inline int                 CountItems() const\r
-    {\r
-        return m_Marks.GetSize();\r
-    }\r
-\r
-    inline CPDF_ContentMarkItem&       GetItem(int index) const\r
-    {\r
-        return m_Marks[index];\r
-    }\r
-\r
-    int                                        GetMCID() const;\r
-\r
-    void                               AddMark(const CFX_ByteString& name, CPDF_Dictionary* pDict, FX_BOOL bDictNeedClone);\r
-\r
-    void                               DeleteLastMark();\r
-private:\r
-\r
-    CFX_ObjectArray<CPDF_ContentMarkItem>      m_Marks;\r
-};\r
-class CPDF_ContentMark : public CFX_CountRef<CPDF_ContentMarkData>\r
-{\r
-public:\r
-\r
-    int                                        GetMCID() const\r
-    {\r
-        return m_pObject ? m_pObject->GetMCID() : -1;\r
-    }\r
-\r
-    FX_BOOL                            HasMark(FX_BSTR mark) const;\r
-\r
-    FX_BOOL                            LookupMark(FX_BSTR mark, CPDF_Dictionary*& pDict) const;\r
-};\r
-#define PDFPAGE_TEXT           1\r
-#define PDFPAGE_PATH           2\r
-#define PDFPAGE_IMAGE          3\r
-#define PDFPAGE_SHADING                4\r
-#define PDFPAGE_FORM           5\r
-#define PDFPAGE_INLINES                6\r
-class CPDF_GraphicStates : public CFX_Object\r
-{\r
-public:\r
-\r
-    void                               CopyStates(const CPDF_GraphicStates& src);\r
-\r
-    void                               DefaultStates();\r
-\r
-    CPDF_ClipPath              m_ClipPath;\r
-\r
-    CPDF_GraphState            m_GraphState;\r
-\r
-    CPDF_ColorState            m_ColorState;\r
-\r
-    CPDF_TextState             m_TextState;\r
-\r
-    CPDF_GeneralState  m_GeneralState;\r
-};\r
-class CPDF_PageObject : public CPDF_GraphicStates\r
-{\r
-public:\r
-\r
-    static CPDF_PageObject* Create(int type);\r
-\r
-    void                               Release();\r
-\r
-    CPDF_PageObject*   Clone() const;\r
-\r
-    void                               Copy(const CPDF_PageObject* pSrcObject);\r
-\r
-    virtual void               Transform(const CFX_AffineMatrix& matrix) = 0;\r
-\r
-\r
-\r
-    void                               RemoveClipPath();\r
-\r
-    void                               AppendClipPath(CPDF_Path path, int type, FX_BOOL bAutoMerge);\r
-\r
-    void                               CopyClipPath(CPDF_PageObject* pObj);\r
-\r
-    void                               TransformClipPath(CFX_AffineMatrix& matrix);\r
-\r
-    void                               TransformGeneralState(CFX_AffineMatrix& matrix);\r
-\r
-\r
-    void                               SetColorState(CPDF_ColorState state)\r
-    {\r
-        m_ColorState = state;\r
-    }\r
-\r
-    FX_RECT                            GetBBox(const CFX_AffineMatrix* pMatrix) const;\r
-\r
-    int                                        m_Type;\r
-\r
-    FX_FLOAT                   m_Left;\r
-\r
-    FX_FLOAT                   m_Right;\r
-\r
-    FX_FLOAT                   m_Top;\r
-\r
-    FX_FLOAT                   m_Bottom;\r
-\r
-    CPDF_ContentMark   m_ContentMark;\r
-protected:\r
-\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObject) {}\r
-\r
-    void                               RecalcBBox();\r
-\r
-    CPDF_PageObject() {}\r
-\r
-    virtual ~CPDF_PageObject() {}\r
-};\r
-struct CPDF_TextObjectItem : public CFX_Object {\r
-\r
-    FX_DWORD                   m_CharCode;\r
-\r
-    FX_FLOAT                   m_OriginX;\r
-\r
-    FX_FLOAT                   m_OriginY;\r
-};\r
-class CPDF_TextObject : public CPDF_PageObject\r
-{\r
-public:\r
-\r
-    CPDF_TextObject();\r
-\r
-    virtual ~CPDF_TextObject();\r
-\r
-    int                                        CountItems() const\r
-    {\r
-        return m_nChars;\r
-    }\r
-\r
-    void                               GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const;\r
-\r
-    int                                        CountChars() const;\r
-\r
-    void                               GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const;\r
-    void                               GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const;\r
-\r
-    void                               GetCharRect(int index, CFX_FloatRect& rect) const;\r
-\r
-\r
-    FX_FLOAT                   GetCharWidth(FX_DWORD charcode) const;\r
-    FX_FLOAT                   GetSpaceCharWidth() const;\r
-\r
-    FX_FLOAT                   GetPosX() const\r
-    {\r
-        return m_PosX;\r
-    }\r
-\r
-    FX_FLOAT                   GetPosY() const\r
-    {\r
-        return m_PosY;\r
-    }\r
-\r
-    void                               GetTextMatrix(CFX_AffineMatrix* pMatrix) const;\r
-\r
-    CPDF_Font*                 GetFont() const\r
-    {\r
-        return m_TextState.GetFont();\r
-    }\r
-\r
-    FX_FLOAT                   GetFontSize() const\r
-    {\r
-        return m_TextState.GetFontSize();\r
-    }\r
-\r
-    void                               SetEmpty();\r
-\r
-    void                               SetText(const CFX_ByteString& text);\r
-\r
-    void                               SetText(CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);\r
-\r
-    void                               SetText(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pKernings);\r
-\r
-    void                               SetPosition(FX_FLOAT x, FX_FLOAT y);\r
-\r
-    void                               SetTextState(CPDF_TextState TextState);\r
-    virtual void               Transform(const CFX_AffineMatrix& matrix);\r
-\r
-    void                               CalcCharPos(FX_FLOAT* pPosArray) const;\r
-\r
-\r
-\r
-    void                               SetData(int nChars, FX_DWORD* pCharCodes, FX_FLOAT* pCharPos, FX_FLOAT x, FX_FLOAT y);\r
-\r
-    void                               GetData(int& nChars, FX_DWORD*& pCharCodes, FX_FLOAT*& pCharPos)\r
-    {\r
-        nChars = m_nChars;\r
-        pCharCodes = m_pCharCodes;\r
-        pCharPos = m_pCharPos;\r
-    }\r
-\r
-\r
-    void                               RecalcPositionData()\r
-    {\r
-        CalcPositionData(NULL, NULL, 1);\r
-    }\r
-protected:\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObject);\r
-\r
-    FX_FLOAT                   m_PosX;\r
-\r
-    FX_FLOAT                   m_PosY;\r
-\r
-    int                                        m_nChars;\r
-\r
-    FX_DWORD*                  m_pCharCodes;\r
-\r
-    FX_FLOAT*          m_pCharPos;\r
-\r
-    void                               SetSegments(const CFX_ByteString* pStrs, FX_FLOAT* pKerning, int nSegs);\r
-\r
-    void                               CalcPositionData(FX_FLOAT* pTextAdvanceX, FX_FLOAT* pTextAdvanceY, FX_FLOAT horz_scale, int level = 0);\r
-    friend class               CPDF_StreamContentParser;\r
-    friend class               CPDF_RenderStatus;\r
-    friend class               CPDF_QuickDrawer;\r
-    friend class               CPDF_TextRenderer;\r
-    friend class               CTextPage;\r
-    friend class               CPDF_ContentGenerator;\r
-};\r
-class CPDF_PathObject : public CPDF_PageObject\r
-{\r
-public:\r
-\r
-    CPDF_PathObject()\r
-    {\r
-        m_Type = PDFPAGE_PATH;\r
-    }\r
-\r
-    virtual ~CPDF_PathObject() {}\r
-    virtual void               Transform(const CFX_AffineMatrix& maxtrix);\r
-\r
-    void                               SetGraphState(CPDF_GraphState GraphState);\r
-\r
-    CPDF_Path                  m_Path;\r
-\r
-    int                                        m_FillType;\r
-\r
-    FX_BOOL                            m_bStroke;\r
-\r
-    CFX_AffineMatrix   m_Matrix;\r
-\r
-\r
-    void                               CalcBoundingBox();\r
-protected:\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObjet);\r
-};\r
-class CPDF_ImageObject : public CPDF_PageObject\r
-{\r
-public:\r
-\r
-    CPDF_ImageObject();\r
-\r
-    virtual ~CPDF_ImageObject();\r
-    virtual void               Transform(const CFX_AffineMatrix& matrix);\r
-\r
-    CPDF_Image*                        m_pImage;\r
-\r
-    CFX_AffineMatrix   m_Matrix;\r
-\r
-    void                               CalcBoundingBox();\r
-private:\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObjet);\r
-};\r
-class CPDF_ShadingObject : public CPDF_PageObject\r
-{\r
-public:\r
-\r
-    CPDF_ShadingObject();\r
-\r
-    virtual ~CPDF_ShadingObject();\r
-\r
-    CPDF_ShadingPattern*       m_pShading;\r
-\r
-    CFX_AffineMatrix   m_Matrix;\r
-\r
-    CPDF_Page*                 m_pPage;\r
-    virtual void               Transform(const CFX_AffineMatrix& matrix);\r
-\r
-    void                               CalcBoundingBox();\r
-protected:\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObjet);\r
-};\r
-class CPDF_FormObject : public CPDF_PageObject\r
-{\r
-public:\r
-\r
-    CPDF_FormObject()\r
-    {\r
-        m_Type = PDFPAGE_FORM;\r
-        m_pForm = NULL;\r
-    }\r
-\r
-    virtual ~CPDF_FormObject();\r
-    virtual void               Transform(const CFX_AffineMatrix& matrix);\r
-\r
-    CPDF_Form*                 m_pForm;\r
-\r
-    CFX_AffineMatrix   m_FormMatrix;\r
-\r
-    void                               CalcBoundingBox();\r
-protected:\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObjet);\r
-};\r
-class CPDF_InlineImages : public CPDF_PageObject\r
-{\r
-public:\r
-\r
-    CPDF_InlineImages();\r
-\r
-    virtual ~CPDF_InlineImages();\r
-\r
-    CPDF_Stream*               m_pStream;\r
-\r
-    CFX_DIBitmap*              m_pBitmap;\r
-\r
-    CFX_ArrayTemplate<CFX_AffineMatrix>        m_Matrices;\r
-\r
-    void                               AddMatrix(CFX_AffineMatrix& matrix);\r
-protected:\r
-    virtual void               Transform(const CFX_AffineMatrix& matrix) {}\r
-    virtual void               CopyData(const CPDF_PageObject* pSrcObjet) {}\r
-};\r
-#endif\r
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by 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
index 9d41539..c6c8077 100644 (file)
-// Copyright 2014 PDFium Authors. All rights reserved.\r
-// Use of this source code is governed by a BSD-style license that can be\r
-// found in the LICENSE file.\r
\r
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
-\r
-#ifndef _FPDF_PARSER_\r
-#define _FPDF_PARSER_\r
-#ifndef _FX_BASIC_H_\r
-#include "../fxcrt/fx_ext.h"\r
-#endif\r
-#ifndef _FPDF_OBJECTS_\r
-#include "fpdf_objects.h"\r
-#endif\r
-class CPDF_Document;\r
-class IPDF_DocParser;\r
-class CPDF_Parser;\r
-class CPDF_SecurityHandler;\r
-class CPDF_StandardSecurityHandler;\r
-class CPDF_CryptoHandler;\r
-class CPDF_Object;\r
-class IFX_FileRead;\r
-class CFDF_Document;\r
-class CFDF_Parser;\r
-class CFX_Font;\r
-class CFX_AffineMatrix;\r
-class CFX_FloatRect;\r
-class CPDF_Point;\r
-class CPDF_DocPageData;\r
-class CPDF_DocRenderData;\r
-class CPDF_ModuleMgr;\r
-class CFX_DIBSource;\r
-class CPDF_Font;\r
-class CPDF_Image;\r
-class CPDF_ColorSpace;\r
-class CPDF_Pattern;\r
-class CPDF_FontEncoding;\r
-class CPDF_IccProfile;\r
-class CFX_PrivateData;\r
-#define FPDFPERM_PRINT                 0x0004\r
-#define FPDFPERM_MODIFY                        0x0008\r
-#define FPDFPERM_EXTRACT               0x0010\r
-#define FPDFPERM_ANNOT_FORM            0x0020\r
-#define FPDFPERM_FILL_FORM             0x0100\r
-#define FPDFPERM_EXTRACT_ACCESS        0x0200\r
-#define FPDFPERM_ASSEMBLE              0x0400\r
-#define FPDFPERM_PRINT_HIGH            0x0800\r
-#define FPDF_PAGE_MAX_NUM              0xFFFFF\r
-class IPDF_EnumPageHandler\r
-{\r
-public:\r
-\r
-    virtual FX_BOOL EnumPage(CPDF_Dictionary* pPageDict) = 0;\r
-};\r
-class CPDF_Document : public CFX_PrivateData, public CPDF_IndirectObjects\r
-{\r
-public:\r
-\r
-    CPDF_Document(IPDF_DocParser* pParser);\r
-\r
-    CPDF_Document();\r
-\r
-    ~CPDF_Document();\r
-\r
-    IPDF_DocParser*                    GetParser() const\r
-    {\r
-        return m_pParser;\r
-    }\r
-\r
-    CPDF_Dictionary*           GetRoot() const\r
-    {\r
-        return m_pRootDict;\r
-    }\r
-\r
-    CPDF_Dictionary*           GetInfo() const\r
-    {\r
-        return m_pInfoDict;\r
-    }\r
-\r
-    void                                       GetID(CFX_ByteString& id1, CFX_ByteString& id2) const\r
-    {\r
-        id1 = m_ID1;\r
-        id2 = m_ID2;\r
-    }\r
-\r
-    int                                                GetPageCount() const;\r
-\r
-    CPDF_Dictionary*           GetPage(int iPage);\r
-\r
-    int                                                GetPageIndex(FX_DWORD objnum);\r
-\r
-    void                                       EnumPages(IPDF_EnumPageHandler* pHandler);\r
-\r
-    FX_DWORD                           GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;\r
-\r
-    FX_BOOL                                    IsOwner() const;\r
-\r
-\r
-\r
-    CPDF_DocPageData*          GetPageData()\r
-    {\r
-        return GetValidatePageData();\r
-    }\r
-\r
-    void                                       ClearPageData();\r
-\r
-    void                                       RemoveColorSpaceFromPageData(CPDF_Object* pObject);\r
-\r
-\r
-    CPDF_DocRenderData*                GetRenderData()\r
-    {\r
-        return GetValidateRenderData();\r
-    }\r
-\r
-    void                                       ClearRenderData();\r
-\r
-    void                                       ClearRenderFont();\r
-\r
-\r
-    FX_BOOL                                    IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const;\r
-\r
-\r
-\r
-\r
-    CPDF_Font*                         LoadFont(CPDF_Dictionary* pFontDict);\r
-\r
-    CPDF_Font*                         FindFont(CPDF_Dictionary* pFontDict);\r
-\r
-    CPDF_ColorSpace*           LoadColorSpace(CPDF_Object* pCSObj, CPDF_Dictionary* pResources = NULL);\r
-\r
-    CPDF_Pattern*                      LoadPattern(CPDF_Object* pObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix = NULL);\r
-\r
-    CPDF_Image*                                LoadImageF(CPDF_Object* pObj);\r
-\r
-    CPDF_StreamAcc*                    LoadFontFile(CPDF_Stream* pStream);\r
-\r
-    CPDF_IccProfile*           LoadIccProfile(CPDF_Stream* pStream, int nComponents);\r
-\r
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_\r
-\r
-    CPDF_Font*                         AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);\r
-    CPDF_Font*                         AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);\r
-#endif\r
-#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_\r
-    CPDF_Font*              AddMacFont(CTFontRef pFont, FX_BOOL bVert, FX_BOOL bTranslateName = FALSE);\r
-#endif\r
-\r
-    CPDF_Font*                         AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding);\r
-\r
-\r
-    CPDF_Font*                         AddFont(CFX_Font* pFont, int charset, FX_BOOL bVert);\r
-\r
-    void                                       CreateNewDoc();\r
-\r
-    CPDF_Dictionary*           CreateNewPage(int iPage);\r
-\r
-    void                                       DeletePage(int iPage);\r
-\r
-    void                                       LoadDoc();\r
-    void                                       LoadAsynDoc(CPDF_Dictionary *pLinearized);\r
-    void                                       LoadPages();\r
-protected:\r
-\r
-    CPDF_Dictionary*           m_pRootDict;\r
-\r
-    CPDF_Dictionary*           m_pInfoDict;\r
-\r
-    CFX_ByteString                     m_ID1;\r
-\r
-    CFX_ByteString                     m_ID2;\r
-\r
-\r
-    FX_BOOL                                    m_bLinearized;\r
-\r
-    FX_DWORD                           m_dwFirstPageNo;\r
-\r
-    FX_DWORD                           m_dwFirstPageObjNum;\r
-\r
-    CFX_DWordArray                     m_PageList;\r
-\r
-    int                                                _GetPageCount() const;\r
-    CPDF_Dictionary*           _FindPDFPage(CPDF_Dictionary* pPages, int iPage, int nPagesToGo, int level);\r
-    int                                                _FindPageIndex(CPDF_Dictionary* pNode, FX_DWORD& skip_count, FX_DWORD objnum, int& index, int level = 0);\r
-    FX_BOOL                                    IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pPageDict);\r
-    FX_BOOL                                    CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting);\r
-    CPDF_DocPageData*          GetValidatePageData();\r
-    CPDF_DocRenderData*                GetValidateRenderData();\r
-    friend class                       CPDF_Creator;\r
-    friend class                       CPDF_Parser;\r
-    friend class                       CPDF_DataAvail;\r
-    friend class                       CPDF_OCContext;\r
-\r
-\r
-\r
-    CPDF_DocPageData*          m_pDocPage;\r
-\r
-    CPDF_DocRenderData*                m_pDocRender;\r
-\r
-};\r
-\r
-#define PDFWORD_EOF                    0\r
-#define PDFWORD_NUMBER         1\r
-#define PDFWORD_TEXT           2\r
-#define PDFWORD_DELIMITER      3\r
-#define PDFWORD_NAME           4\r
-class CPDF_SimpleParser : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_SimpleParser(FX_LPCBYTE pData, FX_DWORD dwSize);\r
-\r
-    CPDF_SimpleParser(FX_BSTR str);\r
-\r
-    CFX_ByteStringC            GetWord();\r
-\r
-    FX_BOOL                            SearchToken(FX_BSTR token);\r
-\r
-    FX_BOOL                            SkipWord(FX_BSTR token);\r
-\r
-    FX_BOOL                            FindTagPair(FX_BSTR start_token, FX_BSTR end_token,\r
-                                    FX_DWORD& start_pos, FX_DWORD& end_pos);\r
-\r
-    FX_BOOL                            FindTagParam(FX_BSTR token, int nParams);\r
-\r
-    FX_DWORD                   GetPos()\r
-    {\r
-        return m_dwCurPos;\r
-    }\r
-\r
-    void                               SetPos(FX_DWORD pos)\r
-    {\r
-        ASSERT(pos <= m_dwSize);\r
-        m_dwCurPos = pos;\r
-    }\r
-private:\r
-\r
-    void                               ParseWord(FX_LPCBYTE& pStart, FX_DWORD& dwSize, int& type);\r
-\r
-    FX_LPCBYTE                 m_pData;\r
-\r
-    FX_DWORD                   m_dwSize;\r
-\r
-    FX_DWORD                   m_dwCurPos;\r
-};\r
-class CPDF_SyntaxParser : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_SyntaxParser();\r
-\r
-    ~CPDF_SyntaxParser();\r
-\r
-    void                               InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOffset);\r
-\r
-    FX_FILESIZE                        SavePos()\r
-    {\r
-        return m_Pos;\r
-    }\r
-\r
-    void                               RestorePos(FX_FILESIZE pos)\r
-    {\r
-        m_Pos = pos;\r
-    }\r
-\r
-    CPDF_Object*               GetObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL, FX_BOOL bDecrypt = TRUE);\r
-\r
-\r
-    CPDF_Object*               GetObjectByStrict(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, FX_DWORD gennum, int level, struct PARSE_CONTEXT* pContext = NULL);\r
-\r
-    int                                        GetDirectNum();\r
-\r
-    CFX_ByteString             GetString(FX_DWORD objnum, FX_DWORD gennum);\r
-\r
-    CFX_ByteString             GetName();\r
-\r
-    CFX_ByteString             GetKeyword();\r
-\r
-    void                               GetBinary(FX_BYTE* buffer, FX_DWORD size);\r
-\r
-    void                               ToNextLine();\r
-\r
-    void                               ToNextWord();\r
-\r
-    FX_BOOL                            SearchWord(FX_BSTR word, FX_BOOL bWholeWord, FX_BOOL bForward, FX_FILESIZE limit);\r
-\r
-    int                                        SearchMultiWord(FX_BSTR words, FX_BOOL bWholeWord, FX_FILESIZE limit);\r
-\r
-    FX_FILESIZE                        FindTag(FX_BSTR tag, FX_FILESIZE limit);\r
-\r
-    void                               SetEncrypt(CPDF_CryptoHandler* pCryptoHandler)\r
-    {\r
-        m_pCryptoHandler = pCryptoHandler;\r
-    }\r
-\r
-    FX_BOOL                            IsEncrypted()\r
-    {\r
-        return m_pCryptoHandler != NULL;\r
-    }\r
-\r
-    FX_BOOL                            GetCharAt(FX_FILESIZE pos, FX_BYTE& ch);\r
-\r
-    FX_BOOL                            ReadBlock(FX_BYTE* pBuf, FX_DWORD size);\r
-\r
-    CFX_ByteString             GetNextWord(FX_BOOL& bIsNumber);\r
-protected:\r
-\r
-    virtual FX_BOOL                            GetNextChar(FX_BYTE& ch);\r
-\r
-    FX_BOOL                            GetCharAtBackward(FX_FILESIZE pos, FX_BYTE& ch);\r
-\r
-    void                               GetNextWord();\r
-\r
-    FX_BOOL                            IsWholeWord(FX_FILESIZE startpos, FX_FILESIZE limit, FX_LPCBYTE tag, FX_DWORD taglen);\r
-\r
-    CFX_ByteString             ReadString();\r
-\r
-    CFX_ByteString             ReadHexString();\r
-\r
-    CPDF_Stream*               ReadStream(CPDF_Dictionary* pDict, PARSE_CONTEXT* pContext, FX_DWORD objnum, FX_DWORD gennum);\r
-\r
-    FX_FILESIZE                        m_Pos;\r
-\r
-    FX_BOOL                            m_bFileStream;\r
-\r
-    int                                        m_MetadataObjnum;\r
-\r
-    IFX_FileRead*              m_pFileAccess;\r
-\r
-    FX_DWORD                   m_HeaderOffset;\r
-\r
-    FX_FILESIZE                        m_FileLen;\r
-\r
-    FX_BYTE*                   m_pFileBuf;\r
-\r
-    FX_DWORD                   m_BufSize;\r
-\r
-    FX_FILESIZE                        m_BufOffset;\r
-\r
-    CPDF_CryptoHandler*        m_pCryptoHandler;\r
-\r
-    FX_BYTE                            m_WordBuffer[257];\r
-\r
-    FX_DWORD                   m_WordSize;\r
-\r
-    FX_BOOL                            m_bIsNumber;\r
-\r
-    FX_FILESIZE                        m_dwWordPos;\r
-    friend class               CPDF_Parser;\r
-    friend class               CPDF_DataAvail;\r
-};\r
-\r
-#define PDFPARSE_TYPEONLY      1\r
-#define PDFPARSE_NOSTREAM      2\r
-struct PARSE_CONTEXT {\r
-\r
-    FX_BOOL            m_Flags;\r
-\r
-    FX_FILESIZE        m_DictStart;\r
-\r
-    FX_FILESIZE        m_DictEnd;\r
-\r
-    FX_FILESIZE        m_DataStart;\r
-\r
-    FX_FILESIZE        m_DataEnd;\r
-};\r
-class IPDF_DocParser : public CFX_Object\r
-{\r
-public:\r
-\r
-    virtual FX_DWORD   GetRootObjNum() = 0;\r
-\r
-    virtual FX_DWORD   GetInfoObjNum() = 0;\r
-\r
-    virtual CPDF_Object*       ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL) = 0;\r
-\r
-    virtual FX_DWORD   GetLastObjNum() = 0;\r
-\r
-    virtual CPDF_Array*        GetIDArray() = 0;\r
-\r
-    virtual CPDF_Dictionary*   GetEncryptDict() = 0;\r
-\r
-    FX_BOOL                            IsEncrypted()\r
-    {\r
-        return GetEncryptDict() != NULL;\r
-    }\r
-\r
-    virtual FX_DWORD   GetPermissions(FX_BOOL bCheckRevision = FALSE) = 0;\r
-\r
-    virtual FX_BOOL            IsOwner() = 0;\r
-\r
-    virtual FX_BOOL            IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) = 0;\r
-};\r
-\r
-#define PDFPARSE_ERROR_SUCCESS         0\r
-#define PDFPARSE_ERROR_FILE                    1\r
-#define PDFPARSE_ERROR_FORMAT          2\r
-#define PDFPARSE_ERROR_PASSWORD                3\r
-#define PDFPARSE_ERROR_HANDLER         4\r
-#define PDFPARSE_ERROR_CERT                    5\r
-class CPDF_Parser : public IPDF_DocParser\r
-{\r
-public:\r
-\r
-    CPDF_Parser();\r
-\r
-    ~CPDF_Parser();\r
-\r
-    FX_DWORD                   StartParse(FX_LPCSTR filename, FX_BOOL bReParse = FALSE);\r
-\r
-    FX_DWORD                   StartParse(FX_LPCWSTR filename, FX_BOOL bReParse = FALSE);\r
-\r
-    FX_DWORD                   StartParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);\r
-\r
-    void                               CloseParser(FX_BOOL bReParse = FALSE);\r
-\r
-    virtual FX_DWORD   GetPermissions(FX_BOOL bCheckRevision = FALSE);\r
-\r
-    virtual FX_BOOL            IsOwner();\r
-\r
-    void                               SetPassword(const FX_CHAR* password)\r
-    {\r
-        m_Password = password;\r
-    }\r
-\r
-    CFX_ByteString             GetPassword()\r
-    {\r
-        return m_Password;\r
-    }\r
-\r
-    CPDF_SecurityHandler* GetSecurityHandler()\r
-    {\r
-        return m_pSecurityHandler;\r
-    }\r
-\r
-    CPDF_CryptoHandler*        GetCryptoHandler()\r
-    {\r
-        return m_Syntax.m_pCryptoHandler;\r
-    }\r
-\r
-    void                               SetSecurityHandler(CPDF_SecurityHandler* pSecurityHandler, FX_BOOL bForced = FALSE);\r
-\r
-    CFX_ByteString             GetRecipient()\r
-    {\r
-        return m_bsRecipient;\r
-    }\r
-\r
-    CPDF_Dictionary*   GetTrailer()\r
-    {\r
-        return m_pTrailer;\r
-    }\r
-\r
-    FX_FILESIZE                        GetLastXRefOffset()\r
-    {\r
-        return m_LastXRefOffset;\r
-    }\r
-\r
-    CPDF_Document*             GetDocument()\r
-    {\r
-        return m_pDocument;\r
-    }\r
-    CFX_ArrayTemplate<CPDF_Dictionary *> * GetOtherTrailers()\r
-    {\r
-        return &m_Trailers;\r
-    }\r
-\r
-    virtual FX_DWORD   GetRootObjNum();\r
-    virtual FX_DWORD   GetInfoObjNum();\r
-    virtual CPDF_Array*        GetIDArray();\r
-    virtual CPDF_Dictionary*   GetEncryptDict()\r
-    {\r
-        return m_pEncryptDict;\r
-    }\r
-    virtual CPDF_Object*               ParseIndirectObject(CPDF_IndirectObjects* pObjList, FX_DWORD objnum, PARSE_CONTEXT* pContext = NULL);\r
-    virtual FX_DWORD   GetLastObjNum();\r
-    virtual FX_BOOL            IsFormStream(FX_DWORD objnum, FX_BOOL& bForm);\r
-\r
-    FX_FILESIZE                        GetObjectOffset(FX_DWORD objnum);\r
-\r
-    FX_FILESIZE                        GetObjectSize(FX_DWORD objnum);\r
-\r
-    int                                        GetObjectVersion(FX_DWORD objnum)\r
-    {\r
-        return m_ObjVersion[objnum];\r
-    }\r
-\r
-    void                               GetIndirectBinary(FX_DWORD objnum, FX_BYTE*& pBuffer, FX_DWORD& size);\r
-\r
-    FX_BOOL                            GetFileStreamOption()\r
-    {\r
-        return m_Syntax.m_bFileStream;\r
-    }\r
-\r
-    void                               SetFileStreamOption(FX_BOOL b)\r
-    {\r
-        m_Syntax.m_bFileStream = b;\r
-    }\r
-\r
-    IFX_FileRead*              GetFileAccess() const\r
-    {\r
-        return m_Syntax.m_pFileAccess;\r
-    }\r
-\r
-    int                                        GetFileVersion() const\r
-    {\r
-        return m_FileVersion;\r
-    }\r
-\r
-    FX_BOOL                            IsXRefStream() const\r
-    {\r
-        return m_bXRefStream;\r
-    }\r
-    CPDF_Object*               ParseIndirectObjectAt(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,\r
-            struct PARSE_CONTEXT* pContext);\r
-\r
-    CPDF_Object*               ParseIndirectObjectAtByStrict(CPDF_IndirectObjects* pObjList, FX_FILESIZE pos, FX_DWORD objnum,\r
-            struct PARSE_CONTEXT* pContext, FX_FILESIZE *pResultPos);\r
-\r
-    FX_DWORD                   StartAsynParse(IFX_FileRead* pFile, FX_BOOL bReParse = FALSE, FX_BOOL bOwnFileRead = TRUE);\r
-\r
-    FX_DWORD                   GetFirstPageNo()\r
-    {\r
-        return m_dwFirstPageNo;\r
-    }\r
-protected:\r
-\r
-    CPDF_Document*             m_pDocument;\r
-\r
-    CPDF_SyntaxParser  m_Syntax;\r
-    FX_BOOL                            m_bOwnFileRead;\r
-    CPDF_Object*               ParseDirect(CPDF_Object* pObj);\r
-\r
-    FX_BOOL                            LoadAllCrossRefV4(FX_FILESIZE pos);\r
-\r
-    FX_BOOL                            LoadAllCrossRefV5(FX_FILESIZE pos);\r
-\r
-    FX_BOOL                            LoadCrossRefV4(FX_FILESIZE pos, FX_FILESIZE streampos, FX_BOOL bSkip, FX_BOOL bFirst);\r
-\r
-    FX_BOOL                            LoadCrossRefV5(FX_FILESIZE pos, FX_FILESIZE& prev, FX_BOOL bMainXRef);\r
-\r
-    CPDF_Dictionary*   LoadTrailerV4();\r
-\r
-    FX_BOOL                            RebuildCrossRef();\r
-\r
-    FX_DWORD                   SetEncryptHandler();\r
-\r
-    void                               ReleaseEncryptHandler();\r
-\r
-    FX_BOOL                            LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);\r
-\r
-    FX_BOOL                            LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);\r
-\r
-    FX_BOOL                            LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);\r
-\r
-    FX_DWORD                   LoadLinearizedMainXRefTable();\r
-\r
-    CFX_MapPtrToPtr            m_ObjectStreamMap;\r
-\r
-    CPDF_StreamAcc*            GetObjectStream(FX_DWORD number);\r
-\r
-    FX_BOOL                            IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);\r
-\r
-\r
-\r
-    int                                        m_FileVersion;\r
-\r
-    CPDF_Dictionary*   m_pTrailer;\r
-\r
-    CPDF_Dictionary*   m_pEncryptDict;\r
-    void SetEncryptDictionary(CPDF_Dictionary* pDict);\r
-\r
-    FX_FILESIZE                        m_LastXRefOffset;\r
-\r
-    FX_BOOL                            m_bXRefStream;\r
-\r
-\r
-    CPDF_SecurityHandler*      m_pSecurityHandler;\r
-\r
-    FX_BOOL                                    m_bForceUseSecurityHandler;\r
-\r
-    CFX_ByteString                     m_bsRecipient;\r
-\r
-    CFX_ByteString             m_FilePath;\r
-\r
-    CFX_ByteString             m_Password;\r
-\r
-    CFX_FileSizeArray  m_CrossRef;\r
-\r
-    CFX_ByteArray              m_V5Type;\r
-\r
-    CFX_FileSizeArray  m_SortedOffset;\r
-\r
-    CFX_WordArray              m_ObjVersion;\r
-    CFX_ArrayTemplate<CPDF_Dictionary *>       m_Trailers;\r
-\r
-    FX_BOOL                            m_bVersionUpdated;\r
-\r
-    CPDF_Object*               m_pLinearized;\r
-\r
-    FX_DWORD                   m_dwFirstPageNo;\r
-\r
-    FX_DWORD                   m_dwXrefStartObjNum;\r
-    friend class               CPDF_Creator;\r
-    friend class               CPDF_DataAvail;\r
-};\r
-#define FXCIPHER_NONE  0\r
-#define FXCIPHER_RC4   1\r
-#define FXCIPHER_AES   2\r
-#define FXCIPHER_AES2   3\r
-class CPDF_SecurityHandler : public CFX_Object\r
-{\r
-public:\r
-\r
-    virtual ~CPDF_SecurityHandler() {}\r
-\r
-    virtual FX_BOOL            OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) = 0;\r
-\r
-    virtual FX_DWORD   GetPermissions() = 0;\r
-\r
-    virtual FX_BOOL            IsOwner() = 0;\r
-\r
-    virtual FX_BOOL            GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen) = 0;\r
-\r
-    virtual FX_BOOL            IsMetadataEncrypted()\r
-    {\r
-        return TRUE;\r
-    }\r
-\r
-    virtual CPDF_CryptoHandler*        CreateCryptoHandler() = 0;\r
-\r
-    virtual CPDF_StandardSecurityHandler* GetStandardHandler()\r
-    {\r
-        return NULL;\r
-    }\r
-};\r
-#define PDF_ENCRYPT_CONTENT                            0\r
-class CPDF_StandardSecurityHandler : public CPDF_SecurityHandler\r
-{\r
-public:\r
-    CPDF_StandardSecurityHandler();\r
-\r
-    virtual ~CPDF_StandardSecurityHandler();\r
-    virtual FX_BOOL            OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict);\r
-    virtual FX_DWORD   GetPermissions();\r
-    virtual FX_BOOL            IsOwner()\r
-    {\r
-        return m_bOwner;\r
-    }\r
-    virtual FX_BOOL            GetCryptInfo(int& cipher, FX_LPCBYTE& buffer, int& keylen);\r
-    virtual FX_BOOL            IsMetadataEncrypted();\r
-    virtual CPDF_CryptoHandler*        CreateCryptoHandler();\r
-    virtual CPDF_StandardSecurityHandler* GetStandardHandler()\r
-    {\r
-        return this;\r
-    }\r
-\r
-    void                               OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,\r
-                                 FX_LPCBYTE user_pass, FX_DWORD user_size,\r
-                                 FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_DWORD type = PDF_ENCRYPT_CONTENT);\r
-\r
-    void                               OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,\r
-                                 FX_LPCBYTE user_pass, FX_DWORD user_size, FX_DWORD type = PDF_ENCRYPT_CONTENT);\r
-\r
-    CFX_ByteString             GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size);\r
-    CFX_ByteString             GetUserPassword(FX_LPCBYTE owner_pass, FX_DWORD pass_size, FX_INT32 key_len);\r
-    int                                        GetVersion()\r
-    {\r
-        return m_Version;\r
-    }\r
-    int                                        GetRevision()\r
-    {\r
-        return m_Revision;\r
-    }\r
-\r
-    int                                        CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key);\r
-    int                                        CheckPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_BOOL bOwner, FX_LPBYTE key, int key_len);\r
-private:\r
-\r
-    int                                        m_Version;\r
-\r
-    int                                        m_Revision;\r
-\r
-    CPDF_Parser*               m_pParser;\r
-\r
-    CPDF_Dictionary*   m_pEncryptDict;\r
-\r
-    FX_BOOL                            LoadDict(CPDF_Dictionary* pEncryptDict);\r
-    FX_BOOL                            LoadDict(CPDF_Dictionary* pEncryptDict, FX_DWORD type, int& cipher, int& key_len);\r
-\r
-    FX_BOOL                            CheckUserPassword(FX_LPCBYTE password, FX_DWORD pass_size,\r
-                                          FX_BOOL bIgnoreEncryptMeta, FX_LPBYTE key, FX_INT32 key_len);\r
-\r
-    FX_BOOL                            CheckOwnerPassword(FX_LPCBYTE password, FX_DWORD pass_size, FX_LPBYTE key, FX_INT32 key_len);\r
-    FX_BOOL                            AES256_CheckPassword(FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPBYTE key);\r
-    void                               AES256_SetPassword(CPDF_Dictionary* pEncryptDict, FX_LPCBYTE password, FX_DWORD size, FX_BOOL bOwner, FX_LPCBYTE key);\r
-    void                               AES256_SetPerms(CPDF_Dictionary* pEncryptDict, FX_DWORD permission, FX_BOOL bEncryptMetadata, FX_LPCBYTE key);\r
-    void                               OnCreate(CPDF_Dictionary* pEncryptDict, CPDF_Array* pIdArray,\r
-                                 FX_LPCBYTE user_pass, FX_DWORD user_size,\r
-                                 FX_LPCBYTE owner_pass, FX_DWORD owner_size, FX_BOOL bDefault, FX_DWORD type);\r
-    FX_BOOL                            CheckSecurity(FX_INT32 key_len);\r
-\r
-    FX_BOOL                            m_bOwner;\r
-\r
-    FX_DWORD                   m_Permissions;\r
-\r
-    int                                        m_Cipher;\r
-\r
-    FX_BYTE                            m_EncryptKey[32];\r
-\r
-    int                                        m_KeyLen;\r
-};\r
-class CPDF_CryptoHandler : public CFX_Object\r
-{\r
-public:\r
-\r
-    virtual ~CPDF_CryptoHandler() {}\r
-\r
-    virtual FX_BOOL            Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler) = 0;\r
-\r
-    virtual FX_DWORD   DecryptGetSize(FX_DWORD src_size) = 0;\r
-\r
-    virtual FX_LPVOID  DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0;\r
-\r
-    virtual FX_BOOL            DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf) = 0;\r
-\r
-    virtual FX_BOOL            DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf) = 0;\r
-\r
-\r
-    virtual FX_DWORD   EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;\r
-\r
-    virtual FX_BOOL            EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size,\r
-                                       FX_LPBYTE dest_buf, FX_DWORD& dest_size) = 0;\r
-\r
-    void                               Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str);\r
-};\r
-class CPDF_StandardCryptoHandler : public CPDF_CryptoHandler\r
-{\r
-public:\r
-\r
-    CPDF_StandardCryptoHandler();\r
-\r
-    virtual ~CPDF_StandardCryptoHandler();\r
-\r
-    FX_BOOL                            Init(int cipher, FX_LPCBYTE key, int keylen);\r
-    virtual FX_BOOL            Init(CPDF_Dictionary* pEncryptDict, CPDF_SecurityHandler* pSecurityHandler);\r
-    virtual FX_DWORD   DecryptGetSize(FX_DWORD src_size);\r
-    virtual FX_LPVOID  DecryptStart(FX_DWORD objnum, FX_DWORD gennum);\r
-    virtual FX_BOOL            DecryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf);\r
-    virtual FX_BOOL            DecryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf);\r
-    virtual FX_DWORD   EncryptGetSize(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size);\r
-    virtual FX_BOOL            EncryptContent(FX_DWORD objnum, FX_DWORD version, FX_LPCBYTE src_buf, FX_DWORD src_size,\r
-                                       FX_LPBYTE dest_buf, FX_DWORD& dest_size);\r
-protected:\r
-\r
-    virtual void               CryptBlock(FX_BOOL bEncrypt, FX_DWORD objnum, FX_DWORD gennum, FX_LPCBYTE src_buf, FX_DWORD src_size,\r
-                                   FX_LPBYTE dest_buf, FX_DWORD& dest_size);\r
-    virtual FX_LPVOID  CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt);\r
-    virtual FX_BOOL            CryptStream(FX_LPVOID context, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);\r
-    virtual FX_BOOL            CryptFinish(FX_LPVOID context, CFX_BinaryBuf& dest_buf, FX_BOOL bEncrypt);\r
-\r
-    FX_BYTE                            m_EncryptKey[32];\r
-\r
-    int                                        m_KeyLen;\r
-\r
-    int                                        m_Cipher;\r
-\r
-    FX_LPBYTE                  m_pAESContext;\r
-};\r
-class CPDF_Point : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_Point(FX_FLOAT xx, FX_FLOAT yy)\r
-    {\r
-        x = xx;\r
-        y = yy;\r
-    }\r
-\r
-    FX_FLOAT                   x;\r
-\r
-    FX_FLOAT                   y;\r
-};\r
-\r
-#define CPDF_Rect              CFX_FloatRect\r
-#define CPDF_Matrix            CFX_AffineMatrix\r
-CFX_ByteString PDF_NameDecode(FX_BSTR orig);\r
-CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig);\r
-CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig);\r
-CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, FX_BOOL bHex = FALSE);\r
-CFX_WideString PDF_DecodeText(const CFX_ByteString& str, CFX_CharMap* pCharMap = NULL);\r
-CFX_WideString PDF_DecodeText(FX_LPCBYTE pData, FX_DWORD size, CFX_CharMap* pCharMap = NULL);\r
-CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len = -1, CFX_CharMap* pCharMap = NULL);\r
-FX_FLOAT PDF_ClipFloat(FX_FLOAT f);\r
-class CFDF_Document : public CPDF_IndirectObjects\r
-{\r
-public:\r
-\r
-    static CFDF_Document*      CreateNewDoc();\r
-\r
-    static CFDF_Document*      ParseFile(FX_LPCSTR file_path);\r
-\r
-    static CFDF_Document*      ParseFile(FX_LPCWSTR file_path);\r
-\r
-    static CFDF_Document*      ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE);\r
-\r
-    static CFDF_Document*      ParseMemory(FX_LPCBYTE pData, FX_DWORD size);\r
-\r
-    ~CFDF_Document();\r
-\r
-    FX_BOOL                                    WriteFile(FX_LPCSTR file_path) const;\r
-\r
-    FX_BOOL                                    WriteFile(FX_LPCWSTR file_path) const;\r
-\r
-    FX_BOOL                                    WriteFile(IFX_FileWrite *pFile) const;\r
-\r
-    FX_BOOL                                    WriteBuf(CFX_ByteTextBuf& buf) const;\r
-\r
-    CPDF_Dictionary*           GetRoot() const\r
-    {\r
-        return m_pRootDict;\r
-    }\r
-\r
-    CFX_WideString                     GetWin32Path() const;\r
-protected:\r
-\r
-    CFDF_Document();\r
-    void       ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile);\r
-    CPDF_Dictionary*           m_pRootDict;\r
-    IFX_FileRead*                      m_pFile;\r
-    FX_BOOL                                    m_bOwnFile;\r
-};\r
-\r
-CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec);\r
-void                   FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& fullpath);\r
-\r
-void FlateEncode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);\r
-FX_DWORD FlateDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);\r
-FX_DWORD RunLengthDecode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);\r
-class CPDF_NumberTree : public CFX_Object\r
-{\r
-public:\r
-\r
-    CPDF_NumberTree(CPDF_Dictionary* pRoot)\r
-    {\r
-        m_pRoot = pRoot;\r
-    }\r
-\r
-    CPDF_Object*               LookupValue(int num);\r
-protected:\r
-\r
-    CPDF_Dictionary*   m_pRoot;\r
-};\r
-\r
-class IFX_FileAvail\r
-{\r
-public:\r
-\r
-    virtual FX_BOOL                    IsDataAvail( FX_FILESIZE offset, FX_DWORD size) = 0;\r
-};\r
-class IFX_DownloadHints\r
-{\r
-public:\r
-\r
-    virtual void                       AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;\r
-};\r
-#define PDF_IS_LINEARIZED                      1\r
-#define PDF_NOT_LINEARIZED                     0\r
-#define PDF_UNKNOW_LINEARIZED          -1\r
-#define PDFFORM_NOTAVAIL               0\r
-#define PDFFORM_AVAIL                  1\r
-#define PDFFORM_NOTEXIST               2\r
-class IPDF_DataAvail\r
-{\r
-public:\r
-\r
-    virtual FX_BOOL                    IsDocAvail(IFX_DownloadHints* pHints) = 0;\r
-\r
-\r
-    virtual void                       SetDocument(CPDF_Document* pDoc) = 0;\r
-\r
-\r
-    virtual FX_BOOL                    IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;\r
-\r
-    virtual FX_BOOL                    IsLinearized() = 0;\r
-\r
-    virtual FX_INT32           IsFormAvail(IFX_DownloadHints *pHints) = 0;\r
-\r
-    virtual FX_INT32           IsLinearizedPDF() = 0;\r
-\r
-    virtual void                               GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize) = 0;\r
-};\r
-class CPDF_SortObjNumArray : public CFX_Object\r
-{\r
-public:\r
-\r
-    void AddObjNum(FX_DWORD dwObjNum);\r
-\r
-    FX_BOOL Find(FX_DWORD dwObjNum);\r
-\r
-    void RemoveAll()\r
-    {\r
-        m_number_array.RemoveAll();\r
-    }\r
-protected:\r
-\r
-    FX_BOOL BinarySearch(FX_DWORD value, int &iNext);\r
-protected:\r
-\r
-    CFX_DWordArray                     m_number_array;\r
-};\r
-enum PDF_PAGENODE_TYPE {\r
-    PDF_PAGENODE_UNKOWN = 0,\r
-    PDF_PAGENODE_PAGE,\r
-    PDF_PAGENODE_PAGES,\r
-    PDF_PAGENODE_ARRAY,\r
-};\r
-class CPDF_PageNode : public CFX_Object\r
-{\r
-public:\r
-    CPDF_PageNode() : m_type(PDF_PAGENODE_UNKOWN) {}\r
-    ~CPDF_PageNode();\r
-    PDF_PAGENODE_TYPE  m_type;\r
-    FX_DWORD                   m_dwPageNo;\r
-    CFX_PtrArray               m_childNode;\r
-};\r
-enum PDF_DATAAVAIL_STATUS {\r
-    PDF_DATAAVAIL_HEADER = 0,\r
-    PDF_DATAAVAIL_FIRSTPAGE,\r
-    PDF_DATAAVAIL_FIRSTPAGE_PREPARE,\r
-    PDF_DATAAVAIL_END,\r
-    PDF_DATAAVAIL_CROSSREF,\r
-    PDF_DATAAVAIL_CROSSREF_ITEM,\r
-    PDF_DATAAVAIL_CROSSREF_STREAM,\r
-    PDF_DATAAVAIL_TRAILER,\r
-    PDF_DATAAVAIL_LOADALLCRSOSSREF,\r
-    PDF_DATAAVAIL_ROOT,\r
-    PDF_DATAAVAIL_INFO,\r
-    PDF_DATAAVAIL_ACROFORM,\r
-    PDF_DATAAVAIL_ACROFORM_SUBOBJECT,\r
-    PDF_DATAAVAIL_PAGETREE,\r
-    PDF_DATAAVAIL_PAGE,\r
-    PDF_DATAAVAIL_PAGE_LATERLOAD,\r
-    PDF_DATAAVAIL_RESOURCES,\r
-    PDF_DATAAVAIL_DONE,\r
-    PDF_DATAAVAIL_ERROR,\r
-    PDF_DATAAVAIL_LOADALLFILE,\r
-    PDF_DATAAVAIL_TRAILER_APPEND\r
-};\r
-class CPDF_DataAvail : public CFX_Object, public IPDF_DataAvail\r
-{\r
-public:\r
-\r
-    CPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead);\r
-    ~CPDF_DataAvail();\r
-\r
-    virtual FX_BOOL                            IsDocAvail(IFX_DownloadHints* pHints);\r
-\r
-\r
-    virtual void                               SetDocument(CPDF_Document* pDoc);\r
-\r
-\r
-    virtual FX_BOOL                            IsPageAvail(int iPage, IFX_DownloadHints* pHints);\r
-\r
-    virtual FX_INT32                   IsFormAvail(IFX_DownloadHints *pHints);\r
-\r
-    virtual FX_INT32                   IsLinearizedPDF();\r
-\r
-    virtual FX_BOOL                            IsLinearized()\r
-    {\r
-        return m_bLinearized;\r
-    }\r
-\r
-    virtual void                               GetLinearizedMainXRefInfo(FX_FILESIZE *pPos, FX_DWORD *pSize);\r
-    IFX_FileRead*                              GetFileRead() const\r
-    {\r
-        return m_pFileRead;\r
-    }\r
-    IFX_FileAvail*                             GetFileAvail() const\r
-    {\r
-        return m_pFileAvail;\r
-    }\r
-protected:\r
-    FX_DWORD                                   GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset);\r
-    FX_BOOL                                            IsObjectsAvail(CFX_PtrArray& obj_array, FX_BOOL bParsePage, IFX_DownloadHints* pHints, CFX_PtrArray &ret_array);\r
-    FX_BOOL                                            CheckDocStatus(IFX_DownloadHints *pHints);\r
-    FX_BOOL                                            CheckHeader(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckFirstPage(IFX_DownloadHints *pHints);\r
-    FX_BOOL                                            CheckEnd(IFX_DownloadHints *pHints);\r
-    FX_BOOL                                            CheckCrossRef(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckCrossRefItem(IFX_DownloadHints *pHints);\r
-    FX_BOOL                                            CheckTrailer(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckRoot(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckInfo(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckPages(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckPage(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckResources(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckAnnots(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckAcroForm(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckAcroFormSubObject(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckTrailerAppend(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckPageStatus(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckAllCrossRefStream(IFX_DownloadHints *pHints);\r
-\r
-    FX_DWORD                                   CheckCrossRefStream(IFX_DownloadHints *pHints, FX_FILESIZE &xref_offset);\r
-    FX_BOOL                                            IsLinearizedFile(FX_LPBYTE pData, FX_DWORD dwLen);\r
-    void                                               SetStartOffset(FX_FILESIZE dwOffset);\r
-    FX_BOOL                                            GetNextToken(CFX_ByteString &token);\r
-    FX_BOOL                                            GetNextChar(FX_BYTE &ch);\r
-    CPDF_Object        *                               ParseIndirectObjectAt(FX_FILESIZE pos, FX_DWORD objnum);\r
-    CPDF_Object        *                               GetObject(FX_DWORD objnum, IFX_DownloadHints* pHints, FX_BOOL *pExistInFile);\r
-    FX_BOOL                                            GetPageKids(CPDF_Parser *pParser, CPDF_Object *pPages);\r
-    FX_BOOL                                            PreparePageItem();\r
-    FX_BOOL                                            LoadPages(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            LoadAllXref(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            LoadAllFile(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckLinearizedData(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckFileResources(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            CheckPageAnnots(int iPage, IFX_DownloadHints* pHints);\r
-\r
-    FX_BOOL                                            CheckLinearizedFirstPage(int iPage, IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            HaveResourceAncestor(CPDF_Dictionary *pDict);\r
-    FX_BOOL                                            CheckPage(FX_INT32 iPage, IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            LoadDocPages(IFX_DownloadHints* pHints);\r
-    FX_BOOL                                            LoadDocPage(FX_INT32 iPage, IFX_DownloadHints* pHints);