| 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 _PAGEINT_H_ | 7 #ifndef _PAGEINT_H_ |
| 8 #define _PAGEINT_H_ | 8 #define _PAGEINT_H_ |
| 9 | 9 |
| 10 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 10 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
| 11 #define PARSE_STEP_LIMIT 100 | 11 #define PARSE_STEP_LIMIT 100 |
| 12 #define STREAM_PARSE_BUFSIZE 20480 | 12 #define STREAM_PARSE_BUFSIZE 20480 |
| 13 class CPDF_QuickFontCache; | 13 class CPDF_QuickFontCache; |
| 14 #ifndef _FPDFAPI_MINI_ | |
| 15 class CPDF_StreamParser : public CFX_Object | 14 class CPDF_StreamParser : public CFX_Object |
| 16 { | 15 { |
| 17 public: | 16 public: |
| 18 | 17 |
| 19 CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize); | 18 CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize); |
| 20 ~CPDF_StreamParser(); | 19 ~CPDF_StreamParser(); |
| 21 | 20 |
| 22 CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti
onary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode); | 21 CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc, CPDF_Dicti
onary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode); |
| 23 typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType; | 22 typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType; |
| 24 | 23 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 52 void GetNextWord(FX_BOOL& bIsNumber); | 51 void GetNextWord(FX_BOOL& bIsNumber); |
| 53 CFX_ByteString ReadString(); | 52 CFX_ByteString ReadString(); |
| 54 CFX_ByteString ReadHexString(); | 53 CFX_ByteString ReadHexString(); |
| 55 const FX_BYTE* m_pBuf; | 54 const FX_BYTE* m_pBuf; |
| 56 FX_DWORD m_Size; | 55 FX_DWORD m_Size; |
| 57 FX_DWORD m_Pos; | 56 FX_DWORD m_Pos; |
| 58 FX_BYTE m_WordBuffer[256]; | 57 FX_BYTE m_WordBuffer[256]; |
| 59 FX_DWORD m_WordSize; | 58 FX_DWORD m_WordSize; |
| 60 CPDF_Object* m_pLastObj; | 59 CPDF_Object* m_pLastObj; |
| 61 }; | 60 }; |
| 62 #endif | |
| 63 typedef enum { | 61 typedef enum { |
| 64 PDFOP_CloseFillStrokePath = 0, PDFOP_FillStrokePath, | 62 PDFOP_CloseFillStrokePath = 0, PDFOP_FillStrokePath, |
| 65 PDFOP_CloseEOFillStrokePath, PDFOP_EOFillStrokePath, | 63 PDFOP_CloseEOFillStrokePath, PDFOP_EOFillStrokePath, |
| 66 PDFOP_BeginMarkedContent_Dictionary, PDFOP_BeginImage, | 64 PDFOP_BeginMarkedContent_Dictionary, PDFOP_BeginImage, |
| 67 PDFOP_BeginMarkedContent, PDFOP_BeginText, | 65 PDFOP_BeginMarkedContent, PDFOP_BeginText, |
| 68 PDFOP_BeginSectionUndefined, PDFOP_CurveTo_123, | 66 PDFOP_BeginSectionUndefined, PDFOP_CurveTo_123, |
| 69 PDFOP_ConcatMatrix, PDFOP_SetColorSpace_Fill, | 67 PDFOP_ConcatMatrix, PDFOP_SetColorSpace_Fill, |
| 70 PDFOP_SetColorSpace_Stroke, PDFOP_SetDash, | 68 PDFOP_SetColorSpace_Stroke, PDFOP_SetDash, |
| 71 PDFOP_SetCharWidth, PDFOP_SetCachedDevice, | 69 PDFOP_SetCharWidth, PDFOP_SetCachedDevice, |
| 72 PDFOP_ExecuteXObject, PDFOP_MarkPlace_Dictionary, | 70 PDFOP_ExecuteXObject, PDFOP_MarkPlace_Dictionary, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 FX_FLOAT m_Float; | 108 FX_FLOAT m_Float; |
| 111 }; | 109 }; |
| 112 } m_Number; | 110 } m_Number; |
| 113 CPDF_Object* m_pObject; | 111 CPDF_Object* m_pObject; |
| 114 struct { | 112 struct { |
| 115 int m_Len; | 113 int m_Len; |
| 116 char m_Buffer[32]; | 114 char m_Buffer[32]; |
| 117 } m_Name; | 115 } m_Name; |
| 118 }; | 116 }; |
| 119 } _ContentParam; | 117 } _ContentParam; |
| 120 #if defined(_FPDFAPI_MINI_) | |
| 121 #define _FPDF_MAX_FORM_LEVEL_ 17 | |
| 122 #else | |
| 123 #define _FPDF_MAX_FORM_LEVEL_ 30 | 118 #define _FPDF_MAX_FORM_LEVEL_ 30 |
| 124 #endif | |
| 125 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 | 119 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 |
| 126 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 | 120 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 |
| 127 class CPDF_StreamContentParser : public CFX_Object | 121 class CPDF_StreamContentParser : public CFX_Object |
| 128 { | 122 { |
| 129 public: | 123 public: |
| 130 CPDF_StreamContentParser(); | 124 CPDF_StreamContentParser(); |
| 131 ~CPDF_StreamContentParser(); | 125 ~CPDF_StreamContentParser(); |
| 132 FX_BOOL Initialize(); | 126 FX_BOOL Initialize(); |
| 133 void PrepareParse(CPDF_Document* pDoc, CPDF_Dictionary* pPageResource
s, CPDF_Dictionary* pParentResources, | 127 void PrepareParse(CPDF_Document* pDoc, CPDF_Dictionary* pPageResource
s, CPDF_Dictionary* pParentResources, |
| 134 CFX_AffineMatrix* pmtContentToUser, | 128 CFX_AffineMatrix* pmtContentToUser, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 156 CFX_ByteString GetString(FX_DWORD index); | 150 CFX_ByteString GetString(FX_DWORD index); |
| 157 FX_FLOAT GetNumber(FX_DWORD index); | 151 FX_FLOAT GetNumber(FX_DWORD index); |
| 158 FX_FLOAT GetNumber16(FX_DWORD index); | 152 FX_FLOAT GetNumber16(FX_DWORD index); |
| 159 int GetInteger(FX_DWORD index) | 153 int GetInteger(FX_DWORD index) |
| 160 { | 154 { |
| 161 return (FX_INT32)(GetNumber(index)); | 155 return (FX_INT32)(GetNumber(index)); |
| 162 } | 156 } |
| 163 FX_BOOL OnOperator(FX_LPCSTR op); | 157 FX_BOOL OnOperator(FX_LPCSTR op); |
| 164 void BigCaseCaller(int index); | 158 void BigCaseCaller(int index); |
| 165 FX_BOOL m_bAbort; | 159 FX_BOOL m_bAbort; |
| 166 #ifndef _FPDFAPI_MINI_ | |
| 167 CPDF_StreamParser* m_pSyntax; | 160 CPDF_StreamParser* m_pSyntax; |
| 168 FX_DWORD GetParsePos() | 161 FX_DWORD GetParsePos() |
| 169 { | 162 { |
| 170 return m_pSyntax->GetPos(); | 163 return m_pSyntax->GetPos(); |
| 171 } | 164 } |
| 172 #else | |
| 173 int m_WordState; | |
| 174 void InputData(FX_LPCBYTE src_buf, FX_DWORD s
rc_size); | |
| 175 void Finish(); | |
| 176 void StartArray(); | |
| 177 void EndArray(); | |
| 178 void StartDict(); | |
| 179 void EndDict(); | |
| 180 void EndName(); | |
| 181 void EndNumber(); | |
| 182 void EndKeyword(); | |
| 183 void EndHexString(); | |
| 184 void EndString(); | |
| 185 void EndImageDict(); | |
| 186 void EndInlineImage(); | |
| 187 FX_LPBYTE m_pWordBuf; | |
| 188 FX_DWORD m_WordSize; | |
| 189 CFX_BinaryBuf m_StringBuf; | |
| 190 int m_StringLevel, m_StringState, m_EscCode; | |
| 191 void AddContainer(CPDF_Object* pObject); | |
| 192 FX_BOOL SetToCurObj(CPDF_Object* pObject); | |
| 193 FX_LPBYTE m_pDictName; | |
| 194 FX_BOOL m_bDictName; | |
| 195 CPDF_Object** m_pObjectStack; | |
| 196 FX_BOOL* m_pObjectState; | |
| 197 FX_DWORD m_ObjectSize; | |
| 198 int m_InlineImageState; | |
| 199 FX_BYTE m_InlineWhiteChar; | |
| 200 CFX_BinaryBuf m_ImageSrcBuf; | |
| 201 FX_LPBYTE m_pStreamBuf; | |
| 202 #endif | |
| 203 CPDF_AllStates* m_pCurStates; | 165 CPDF_AllStates* m_pCurStates; |
| 204 CPDF_ContentMark m_CurContentMark; | 166 CPDF_ContentMark m_CurContentMark; |
| 205 CFX_PtrArray m_ClipTextList; | 167 CFX_PtrArray m_ClipTextList; |
| 206 CPDF_TextObject* m_pLastTextObject; | 168 CPDF_TextObject* m_pLastTextObject; |
| 207 FX_FLOAT m_DefFontSize; | 169 FX_FLOAT m_DefFontSize; |
| 208 void AddTextObject(CFX_ByteString* pText, FX_
FLOAT fInitKerning, FX_FLOAT* pKerning, int count); | 170 void AddTextObject(CFX_ByteString* pText, FX_
FLOAT fInitKerning, FX_FLOAT* pKerning, int count); |
| 209 | 171 |
| 210 void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT&
y); | 172 void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT&
y); |
| 211 void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT&
y); | 173 void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT&
y); |
| 212 void OnChangeTextMatrix(); | 174 void OnChangeTextMatrix(); |
| 213 #ifndef _FPDFAPI_MINI_ | |
| 214 FX_DWORD Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWOR
D max_cost); | 175 FX_DWORD Parse(FX_LPCBYTE pData, FX_DWORD dwSize, FX_DWOR
D max_cost); |
| 215 void ParsePathObject(); | 176 void ParsePathObject(); |
| 216 #endif | |
| 217 int m_CompatCount; | 177 int m_CompatCount; |
| 218 FX_PATHPOINT* m_pPathPoints; | 178 FX_PATHPOINT* m_pPathPoints; |
| 219 int m_PathPointCount; | 179 int m_PathPointCount; |
| 220 int m_PathAllocSize; | 180 int m_PathAllocSize; |
| 221 FX_FLOAT m_PathStartX, m_PathStartY; | 181 FX_FLOAT m_PathStartX, m_PathStartY; |
| 222 FX_FLOAT m_PathCurrentX, m_PathCurrentY; | 182 FX_FLOAT m_PathCurrentX, m_PathCurrentY; |
| 223 int m_PathClipType; | 183 int m_PathClipType; |
| 224 void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int
flag); | 184 void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int
flag); |
| 225 void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_F
LOAT w, FX_FLOAT h); | 185 void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_F
LOAT w, FX_FLOAT h); |
| 226 void AddPathObject(int FillType, FX_BOOL bStr
oke); | 186 void AddPathObject(int FillType, FX_BOOL bStr
oke); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 CFX_ByteString m_Prefix; | 458 CFX_ByteString m_Prefix; |
| 499 int m_nIndex; | 459 int m_nIndex; |
| 500 }; | 460 }; |
| 501 ~CPDF_ResourceNaming(); | 461 ~CPDF_ResourceNaming(); |
| 502 CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCS
TR szType); | 462 CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCS
TR szType); |
| 503 protected: | 463 protected: |
| 504 CFX_MapByteStringToPtr m_NamingCache; | 464 CFX_MapByteStringToPtr m_NamingCache; |
| 505 }; | 465 }; |
| 506 | 466 |
| 507 #endif // _PAGEINT_H_ | 467 #endif // _PAGEINT_H_ |
| OLD | NEW |