OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 virtual FX_BOOL CryptStream(void* context, | 665 virtual FX_BOOL CryptStream(void* context, |
666 const uint8_t* src_buf, | 666 const uint8_t* src_buf, |
667 FX_DWORD src_size, | 667 FX_DWORD src_size, |
668 CFX_BinaryBuf& dest_buf, | 668 CFX_BinaryBuf& dest_buf, |
669 FX_BOOL bEncrypt); | 669 FX_BOOL bEncrypt); |
670 virtual FX_BOOL CryptFinish(void* context, | 670 virtual FX_BOOL CryptFinish(void* context, |
671 CFX_BinaryBuf& dest_buf, | 671 CFX_BinaryBuf& dest_buf, |
672 FX_BOOL bEncrypt); | 672 FX_BOOL bEncrypt); |
673 | 673 |
674 uint8_t m_EncryptKey[32]; | 674 uint8_t m_EncryptKey[32]; |
675 | |
676 int m_KeyLen; | 675 int m_KeyLen; |
677 | |
678 int m_Cipher; | 676 int m_Cipher; |
679 | |
680 uint8_t* m_pAESContext; | 677 uint8_t* m_pAESContext; |
681 }; | 678 }; |
682 class CPDF_Point { | |
683 public: | |
684 CPDF_Point(FX_FLOAT xx, FX_FLOAT yy) { | |
685 x = xx; | |
686 y = yy; | |
687 } | |
688 | 679 |
689 FX_FLOAT x; | |
690 | |
691 FX_FLOAT y; | |
692 }; | |
693 | |
694 #define CPDF_Rect CFX_FloatRect | |
695 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); | 680 CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& orig); |
696 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); | 681 CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig); |
697 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); | 682 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig); |
698 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, | 683 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src, |
699 FX_BOOL bHex = FALSE); | 684 FX_BOOL bHex = FALSE); |
700 CFX_WideString PDF_DecodeText(const uint8_t* pData, FX_DWORD size); | 685 CFX_WideString PDF_DecodeText(const uint8_t* pData, FX_DWORD size); |
701 CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); | 686 CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr); |
702 CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); | 687 CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1); |
703 CFX_ByteString PDF_EncodeText(const CFX_WideString& str); | 688 CFX_ByteString PDF_EncodeText(const CFX_WideString& str); |
704 | 689 |
705 FX_FLOAT PDF_ClipFloat(FX_FLOAT f); | |
706 class CFDF_Document : public CPDF_IndirectObjectHolder { | 690 class CFDF_Document : public CPDF_IndirectObjectHolder { |
707 public: | 691 public: |
708 static CFDF_Document* CreateNewDoc(); | 692 static CFDF_Document* CreateNewDoc(); |
709 static CFDF_Document* ParseFile(IFX_FileRead* pFile, | 693 static CFDF_Document* ParseFile(IFX_FileRead* pFile, |
710 FX_BOOL bOwnFile = FALSE); | 694 FX_BOOL bOwnFile = FALSE); |
711 static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size); | 695 static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size); |
712 | |
713 ~CFDF_Document(); | 696 ~CFDF_Document(); |
714 | 697 |
715 FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const; | 698 FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const; |
716 | |
717 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } | 699 CPDF_Dictionary* GetRoot() const { return m_pRootDict; } |
718 | 700 |
719 protected: | 701 protected: |
720 CFDF_Document(); | 702 CFDF_Document(); |
721 void ParseStream(IFX_FileRead* pFile, FX_BOOL bOwnFile); | 703 void ParseStream(IFX_FileRead* pFile, FX_BOOL bOwnFile); |
| 704 |
722 CPDF_Dictionary* m_pRootDict; | 705 CPDF_Dictionary* m_pRootDict; |
723 IFX_FileRead* m_pFile; | 706 IFX_FileRead* m_pFile; |
724 FX_BOOL m_bOwnFile; | 707 FX_BOOL m_bOwnFile; |
725 }; | 708 }; |
726 | 709 |
727 void FlateEncode(const uint8_t* src_buf, | 710 void FlateEncode(const uint8_t* src_buf, |
728 FX_DWORD src_size, | 711 FX_DWORD src_size, |
729 uint8_t*& dest_buf, | 712 uint8_t*& dest_buf, |
730 FX_DWORD& dest_size); | 713 FX_DWORD& dest_size); |
731 void FlateEncode(const uint8_t* src_buf, | 714 void FlateEncode(const uint8_t* src_buf, |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 FX_DWORD src_size, | 864 FX_DWORD src_size, |
882 const CPDF_Dictionary* pDict, | 865 const CPDF_Dictionary* pDict, |
883 uint8_t*& dest_buf, | 866 uint8_t*& dest_buf, |
884 FX_DWORD& dest_size, | 867 FX_DWORD& dest_size, |
885 CFX_ByteString& ImageEncoding, | 868 CFX_ByteString& ImageEncoding, |
886 CPDF_Dictionary*& pImageParms, | 869 CPDF_Dictionary*& pImageParms, |
887 FX_DWORD estimated_size, | 870 FX_DWORD estimated_size, |
888 FX_BOOL bImageAcc); | 871 FX_BOOL bImageAcc); |
889 | 872 |
890 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 873 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
OLD | NEW |