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 class CPDF_StreamParser : public CFX_Object | 14 class CPDF_StreamParser |
15 { | 15 { |
16 public: | 16 public: |
17 | 17 |
18 CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize); | 18 CPDF_StreamParser(const FX_BYTE* pData, FX_DWORD dwSize); |
19 ~CPDF_StreamParser(); | 19 ~CPDF_StreamParser(); |
20 | 20 |
21 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); |
22 typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType; | 22 typedef enum { EndOfData, Number, Keyword, Name, Others } SyntaxType; |
23 | 23 |
24 SyntaxType ParseNextElement(); | 24 SyntaxType ParseNextElement(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 CPDF_Object* m_pObject; | 111 CPDF_Object* m_pObject; |
112 struct { | 112 struct { |
113 int m_Len; | 113 int m_Len; |
114 char m_Buffer[32]; | 114 char m_Buffer[32]; |
115 } m_Name; | 115 } m_Name; |
116 }; | 116 }; |
117 } _ContentParam; | 117 } _ContentParam; |
118 #define _FPDF_MAX_FORM_LEVEL_ 30 | 118 #define _FPDF_MAX_FORM_LEVEL_ 30 |
119 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 | 119 #define _FPDF_MAX_TYPE3_FORM_LEVEL_ 4 |
120 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 | 120 #define _FPDF_MAX_OBJECT_STACK_SIZE_ 512 |
121 class CPDF_StreamContentParser : public CFX_Object | 121 class CPDF_StreamContentParser |
122 { | 122 { |
123 public: | 123 public: |
124 CPDF_StreamContentParser(); | 124 CPDF_StreamContentParser(); |
125 ~CPDF_StreamContentParser(); | 125 ~CPDF_StreamContentParser(); |
126 FX_BOOL Initialize(); | 126 FX_BOOL Initialize(); |
127 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, |
128 CFX_AffineMatrix* pmtContentToUser, | 128 CFX_AffineMatrix* pmtContentToUser, |
129 CPDF_PageObjects* pObjList, CPDF_Dictionary* pResources
, | 129 CPDF_PageObjects* pObjList, CPDF_Dictionary* pResources
, |
130 CFX_FloatRect* pBBox, CPDF_ParseOptions* pOptions, | 130 CFX_FloatRect* pBBox, CPDF_ParseOptions* pOptions, |
131 CPDF_AllStates* pAllStates, int level); | 131 CPDF_AllStates* pAllStates, int level); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 void Handle_MoveToNextLine(); | 273 void Handle_MoveToNextLine(); |
274 void Handle_CurveTo_23(); | 274 void Handle_CurveTo_23(); |
275 void Handle_SetLineWidth(); | 275 void Handle_SetLineWidth(); |
276 void Handle_Clip(); | 276 void Handle_Clip(); |
277 void Handle_EOClip(); | 277 void Handle_EOClip(); |
278 void Handle_CurveTo_13(); | 278 void Handle_CurveTo_13(); |
279 void Handle_NextLineShowText(); | 279 void Handle_NextLineShowText(); |
280 void Handle_NextLineShowText_Space(); | 280 void Handle_NextLineShowText_Space(); |
281 void Handle_Invalid(); | 281 void Handle_Invalid(); |
282 }; | 282 }; |
283 class CPDF_ContentParser : public CFX_Object | 283 class CPDF_ContentParser |
284 { | 284 { |
285 public: | 285 public: |
286 CPDF_ContentParser(); | 286 CPDF_ContentParser(); |
287 ~CPDF_ContentParser(); | 287 ~CPDF_ContentParser(); |
288 typedef enum { Ready, ToBeContinued, Done } ParseStatus; | 288 typedef enum { Ready, ToBeContinued, Done } ParseStatus; |
289 ParseStatus GetStatus() | 289 ParseStatus GetStatus() |
290 { | 290 { |
291 return m_Status; | 291 return m_Status; |
292 } | 292 } |
293 void Start(CPDF_Page* pPage, CPDF_ParseOption
s* pOptions); | 293 void Start(CPDF_Page* pPage, CPDF_ParseOption
s* pOptions); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 return FALSE; | 352 return FALSE; |
353 } | 353 } |
354 if (findData && ((-- findData->m_nCount) == 0 || bForce)) { | 354 if (findData && ((-- findData->m_nCount) == 0 || bForce)) { |
355 delete findData->m_Obj; | 355 delete findData->m_Obj; |
356 delete findData; | 356 delete findData; |
357 map.RemoveKey(findKey); | 357 map.RemoveKey(findKey); |
358 return TRUE; | 358 return TRUE; |
359 } | 359 } |
360 return FALSE; | 360 return FALSE; |
361 } | 361 } |
362 class CPDF_DocPageData : public CFX_Object | 362 class CPDF_DocPageData |
363 { | 363 { |
364 public: | 364 public: |
365 CPDF_DocPageData(CPDF_Document *pPDFDoc); | 365 CPDF_DocPageData(CPDF_Document *pPDFDoc); |
366 ~CPDF_DocPageData(); | 366 ~CPDF_DocPageData(); |
367 void Clear(FX_BOOL bRelease = FALSE); | 367 void Clear(FX_BOOL bRelease = FALSE); |
368 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL find
Only); | 368 CPDF_Font* GetFont(CPDF_Dictionary* pFontDict, FX_BOOL find
Only); |
369 CPDF_Font* GetStandardFont(FX_BSTR fontName, CPDF_FontEncod
ing* pEncoding); | 369 CPDF_Font* GetStandardFont(FX_BSTR fontName, CPDF_FontEncod
ing* pEncoding); |
370 void ReleaseFont(CPDF_Dictionary* pFontDict); | 370 void ReleaseFont(CPDF_Dictionary* pFontDict); |
371 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictiona
ry* pResources); | 371 CPDF_ColorSpace* GetColorSpace(CPDF_Object* pCSObj, CPDF_Dictiona
ry* pResources); |
372 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); | 372 CPDF_ColorSpace* GetCopiedColorSpace(CPDF_Object* pCSObj); |
(...skipping 13 matching lines...) Expand all Loading... |
386 CPDF_Document* m_pPDFDoc; | 386 CPDF_Document* m_pPDFDoc; |
387 CPDF_FontMap m_FontMap; | 387 CPDF_FontMap m_FontMap; |
388 CPDF_ColorSpaceMap m_ColorSpaceMap; | 388 CPDF_ColorSpaceMap m_ColorSpaceMap; |
389 CPDF_PatternMap m_PatternMap; | 389 CPDF_PatternMap m_PatternMap; |
390 CPDF_ImageMap m_ImageMap; | 390 CPDF_ImageMap m_ImageMap; |
391 CPDF_IccProfileMap m_IccProfileMap; | 391 CPDF_IccProfileMap m_IccProfileMap; |
392 CFX_MapByteStringToPtr m_HashProfileMap; | 392 CFX_MapByteStringToPtr m_HashProfileMap; |
393 CPDF_FontFileMap m_FontFileMap; | 393 CPDF_FontFileMap m_FontFileMap; |
394 FX_BOOL m_bForceClear; | 394 FX_BOOL m_bForceClear; |
395 }; | 395 }; |
396 class CPDF_Function : public CFX_Object | 396 class CPDF_Function |
397 { | 397 { |
398 public: | 398 public: |
399 static CPDF_Function* Load(CPDF_Object* pFuncObj); | 399 static CPDF_Function* Load(CPDF_Object* pFuncObj); |
400 virtual ~CPDF_Function(); | 400 virtual ~CPDF_Function(); |
401 FX_BOOL Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, i
nt& nresults) const; | 401 FX_BOOL Call(FX_FLOAT* inputs, int ninputs, FX_FLOAT* results, i
nt& nresults) const; |
402 int CountInputs() | 402 int CountInputs() |
403 { | 403 { |
404 return m_nInputs; | 404 return m_nInputs; |
405 } | 405 } |
406 int CountOutputs() | 406 int CountOutputs() |
407 { | 407 { |
408 return m_nOutputs; | 408 return m_nOutputs; |
409 } | 409 } |
410 protected: | 410 protected: |
411 CPDF_Function(); | 411 CPDF_Function(); |
412 int m_nInputs, m_nOutputs; | 412 int m_nInputs, m_nOutputs; |
413 FX_FLOAT* m_pDomains; | 413 FX_FLOAT* m_pDomains; |
414 FX_FLOAT* m_pRanges; | 414 FX_FLOAT* m_pRanges; |
415 FX_BOOL Init(CPDF_Object* pObj); | 415 FX_BOOL Init(CPDF_Object* pObj); |
416 virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0; | 416 virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0; |
417 virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0; | 417 virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0; |
418 }; | 418 }; |
419 class CPDF_IccProfile : public CFX_Object | 419 class CPDF_IccProfile |
420 { | 420 { |
421 public: | 421 public: |
422 CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize); | 422 CPDF_IccProfile(FX_LPCBYTE pData, FX_DWORD dwSize); |
423 ~CPDF_IccProfile(); | 423 ~CPDF_IccProfile(); |
424 FX_INT32 GetComponents() const { return m_nSrcComponents; } | 424 FX_INT32 GetComponents() const { return m_nSrcComponents; } |
425 FX_BOOL m_bsRGB; | 425 FX_BOOL m_bsRGB; |
426 FX_INT32 m_nSrcComponents; | 426 FX_INT32 m_nSrcComponents; |
427 FX_LPVOID m_pTransform; | 427 FX_LPVOID m_pTransform; |
428 }; | 428 }; |
429 class CPDF_DeviceCS : public CPDF_ColorSpace | 429 class CPDF_DeviceCS : public CPDF_ColorSpace |
(...skipping 14 matching lines...) Expand all Loading... |
444 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray); | 444 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray); |
445 virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G,
FX_FLOAT& B) const; | 445 virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G,
FX_FLOAT& B) const; |
446 virtual CPDF_ColorSpace* GetBaseCS() const | 446 virtual CPDF_ColorSpace* GetBaseCS() const |
447 { | 447 { |
448 return m_pBaseCS; | 448 return m_pBaseCS; |
449 } | 449 } |
450 CPDF_ColorSpace* m_pBaseCS; | 450 CPDF_ColorSpace* m_pBaseCS; |
451 CPDF_CountedColorSpace* m_pCountedBaseCS; | 451 CPDF_CountedColorSpace* m_pCountedBaseCS; |
452 }; | 452 }; |
453 #define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096 | 453 #define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096 |
454 class CPDF_ResourceNaming : public CFX_Object | 454 class CPDF_ResourceNaming |
455 { | 455 { |
456 public: | 456 public: |
457 struct _NamingState : public CFX_Object { | 457 struct _NamingState { |
458 CFX_ByteString m_Prefix; | 458 CFX_ByteString m_Prefix; |
459 int m_nIndex; | 459 int m_nIndex; |
460 }; | 460 }; |
461 ~CPDF_ResourceNaming(); | 461 ~CPDF_ResourceNaming(); |
462 CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCS
TR szType); | 462 CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCS
TR szType); |
463 protected: | 463 protected: |
464 CFX_MapByteStringToPtr m_NamingCache; | 464 CFX_MapByteStringToPtr m_NamingCache; |
465 }; | 465 }; |
466 | 466 |
467 #endif // _PAGEINT_H_ | 467 #endif // _PAGEINT_H_ |
OLD | NEW |