| 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" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 public: | 357 public: |
| 358 CPDF_AllStates(); | 358 CPDF_AllStates(); |
| 359 ~CPDF_AllStates(); | 359 ~CPDF_AllStates(); |
| 360 void Copy(const CPDF_AllStates& src); | 360 void Copy(const CPDF_AllStates& src); |
| 361 void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pPa
rser); | 361 void ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser* pPa
rser); |
| 362 void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale); | 362 void SetLineDash(CPDF_Array*, FX_FLOAT, FX_FLOAT scale); |
| 363 CFX_AffineMatrix m_TextMatrix, m_CTM, m_ParentMatrix; | 363 CFX_AffineMatrix m_TextMatrix, m_CTM, m_ParentMatrix; |
| 364 FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLin
eY; | 364 FX_FLOAT m_TextX, m_TextY, m_TextLineX, m_TextLin
eY; |
| 365 FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzSca
le; | 365 FX_FLOAT m_TextLeading, m_TextRise, m_TextHorzSca
le; |
| 366 }; | 366 }; |
| 367 template <class ObjClass> class CPDF_CountedObject : public CFX_Object | 367 |
| 368 { | |
| 369 public: | |
| 370 ObjClass» m_Obj; | |
| 371 FX_DWORD» m_nCount; | |
| 372 }; | |
| 373 typedef CFX_MapPtrTemplate<CPDF_Dictionary*, CPDF_CountedObject<CPDF_Font*>*>»
» CPDF_FontMap; | |
| 374 typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_ColorSpace*>*>»
» CPDF_ColorSpaceMap; | |
| 375 typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_Pattern*>*>»
» CPDF_PatternMap; | |
| 376 typedef CFX_MapPtrTemplate<FX_DWORD, CPDF_CountedObject<CPDF_Image*>*>» »
» » CPDF_ImageMap; | |
| 377 typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedObject<CPDF_IccProfile*>*>»
» CPDF_IccProfileMap; | |
| 378 typedef CFX_MapPtrTemplate<CPDF_Stream*, CPDF_CountedObject<CPDF_StreamAcc*>*>»
» CPDF_FontFileMap; | |
| 379 template <class KeyType, class ValueType> | 368 template <class KeyType, class ValueType> |
| 380 KeyType PDF_DocPageData_FindValue(const CFX_MapPtrTemplate<KeyType, CPDF_Counted
Object<ValueType>*> &map, ValueType findValue, CPDF_CountedObject<ValueType>*& f
indData) | 369 KeyType PDF_DocPageData_FindValue(const CFX_MapPtrTemplate<KeyType, CPDF_Counted
Object<ValueType>*> &map, ValueType findValue, CPDF_CountedObject<ValueType>*& f
indData) |
| 381 { | 370 { |
| 382 FX_POSITION pos = map.GetStartPosition(); | 371 FX_POSITION pos = map.GetStartPosition(); |
| 383 while (pos) { | 372 while (pos) { |
| 384 KeyType findKey; | 373 KeyType findKey; |
| 385 map.GetNextAssoc(pos, findKey, findData); | 374 map.GetNextAssoc(pos, findKey, findData); |
| 386 if (findData->m_Obj == findValue) { | 375 if (findData->m_Obj == findValue) { |
| 387 return findKey; | 376 return findKey; |
| 388 } | 377 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 void ReleaseColorSpace(CPDF_Object* pColorSpace); | 413 void ReleaseColorSpace(CPDF_Object* pColorSpace); |
| 425 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, FX_BOOL bSh
ading, const CFX_AffineMatrix* matrix); | 414 CPDF_Pattern* GetPattern(CPDF_Object* pPatternObj, FX_BOOL bSh
ading, const CFX_AffineMatrix* matrix); |
| 426 void ReleasePattern(CPDF_Object* pPatternObj); | 415 void ReleasePattern(CPDF_Object* pPatternObj); |
| 427 CPDF_Image* GetImage(CPDF_Object* pImageStream); | 416 CPDF_Image* GetImage(CPDF_Object* pImageStream); |
| 428 void ReleaseImage(CPDF_Object* pImageStream); | 417 void ReleaseImage(CPDF_Object* pImageStream); |
| 429 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); | 418 CPDF_IccProfile* GetIccProfile(CPDF_Stream* pIccProfileStream); |
| 430 void ReleaseIccProfile(CPDF_Stream* pIccProfileStream
, CPDF_IccProfile* pIccProfile); | 419 void ReleaseIccProfile(CPDF_Stream* pIccProfileStream
, CPDF_IccProfile* pIccProfile); |
| 431 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); | 420 CPDF_StreamAcc* GetFontFileStreamAcc(CPDF_Stream* pFontStream); |
| 432 void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStrea
m, FX_BOOL bForce = FALSE); | 421 void ReleaseFontFileStreamAcc(CPDF_Stream* pFontStrea
m, FX_BOOL bForce = FALSE); |
| 433 FX_BOOL IsForceClear() const {return m_bForceClear;} | 422 FX_BOOL IsForceClear() const {return m_bForceClear;} |
| 423 CPDF_CountedColorSpace* FindColorSpacePtr(CPDF_Object* pCSObj) const; |
| 424 CPDF_CountedPattern* FindPatternPtr(CPDF_Object* pPatternObj) const; |
| 434 | 425 |
| 435 CPDF_Document* m_pPDFDoc; | 426 CPDF_Document* m_pPDFDoc; |
| 436 CPDF_FontMap m_FontMap; | 427 CPDF_FontMap m_FontMap; |
| 437 CPDF_ColorSpaceMap m_ColorSpaceMap; | 428 CPDF_ColorSpaceMap m_ColorSpaceMap; |
| 438 CPDF_PatternMap m_PatternMap; | 429 CPDF_PatternMap m_PatternMap; |
| 439 CPDF_ImageMap m_ImageMap; | 430 CPDF_ImageMap m_ImageMap; |
| 440 CPDF_IccProfileMap m_IccProfileMap; | 431 CPDF_IccProfileMap m_IccProfileMap; |
| 441 CFX_MapByteStringToPtr m_HashProfileMap; | 432 CFX_MapByteStringToPtr m_HashProfileMap; |
| 442 CPDF_FontFileMap m_FontFileMap; | 433 CPDF_FontFileMap m_FontFileMap; |
| 443 FX_BOOL m_bForceClear; | 434 FX_BOOL m_bForceClear; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 public: | 481 public: |
| 491 CPDF_PatternCS(); | 482 CPDF_PatternCS(); |
| 492 ~CPDF_PatternCS(); | 483 ~CPDF_PatternCS(); |
| 493 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray); | 484 virtual FX_BOOL v_Load(CPDF_Document* pDoc, CPDF_Array* pArray); |
| 494 virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G,
FX_FLOAT& B) const; | 485 virtual FX_BOOL GetRGB(FX_FLOAT* pBuf, FX_FLOAT& R, FX_FLOAT& G,
FX_FLOAT& B) const; |
| 495 virtual CPDF_ColorSpace* GetBaseCS() const | 486 virtual CPDF_ColorSpace* GetBaseCS() const |
| 496 { | 487 { |
| 497 return m_pBaseCS; | 488 return m_pBaseCS; |
| 498 } | 489 } |
| 499 CPDF_ColorSpace* m_pBaseCS; | 490 CPDF_ColorSpace* m_pBaseCS; |
| 491 CPDF_CountedColorSpace* m_pCountedBaseCS; |
| 500 }; | 492 }; |
| 501 #define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096 | 493 #define MAX_PAGE_OBJECTS_UNIFY_NAMING 4096 |
| 502 class CPDF_ResourceNaming : public CFX_Object | 494 class CPDF_ResourceNaming : public CFX_Object |
| 503 { | 495 { |
| 504 public: | 496 public: |
| 505 struct _NamingState : public CFX_Object { | 497 struct _NamingState : public CFX_Object { |
| 506 CFX_ByteString m_Prefix; | 498 CFX_ByteString m_Prefix; |
| 507 int m_nIndex; | 499 int m_nIndex; |
| 508 }; | 500 }; |
| 509 ~CPDF_ResourceNaming(); | 501 ~CPDF_ResourceNaming(); |
| 510 CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCS
TR szType); | 502 CFX_ByteString GetName(const CPDF_Dictionary* pResList, FX_LPCS
TR szType); |
| 511 protected: | 503 protected: |
| 512 CFX_MapByteStringToPtr m_NamingCache; | 504 CFX_MapByteStringToPtr m_NamingCache; |
| 513 }; | 505 }; |
| 514 | 506 |
| 515 #endif // _PAGEINT_H_ | 507 #endif // _PAGEINT_H_ |
| OLD | NEW |