| 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_SRC_FPDFTEXT_TEXT_INT_H_ | 7 #ifndef CORE_SRC_FPDFTEXT_TEXT_INT_H_ |
| 8 #define CORE_SRC_FPDFTEXT_TEXT_INT_H_ | 8 #define CORE_SRC_FPDFTEXT_TEXT_INT_H_ |
| 9 | 9 |
| 10 #include "core/include/fpdftext/fpdf_text.h" | 10 #include "core/include/fpdftext/fpdf_text.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #define FPDFTEXT_MC_DELAY 2 | 27 #define FPDFTEXT_MC_DELAY 2 |
| 28 | 28 |
| 29 typedef struct _PAGECHAR_INFO { | 29 typedef struct _PAGECHAR_INFO { |
| 30 int m_CharCode; | 30 int m_CharCode; |
| 31 FX_WCHAR m_Unicode; | 31 FX_WCHAR m_Unicode; |
| 32 FX_FLOAT m_OriginX; | 32 FX_FLOAT m_OriginX; |
| 33 FX_FLOAT m_OriginY; | 33 FX_FLOAT m_OriginY; |
| 34 int32_t m_Flag; | 34 int32_t m_Flag; |
| 35 CFX_FloatRect m_CharBox; | 35 CFX_FloatRect m_CharBox; |
| 36 CPDF_TextObject* m_pTextObj; | 36 CPDF_TextObject* m_pTextObj; |
| 37 CFX_AffineMatrix m_Matrix; | 37 CFX_Matrix m_Matrix; |
| 38 int m_Index; | 38 int m_Index; |
| 39 } PAGECHAR_INFO; | 39 } PAGECHAR_INFO; |
| 40 typedef CFX_SegmentedArray<PAGECHAR_INFO> PAGECHAR_InfoArray; | 40 typedef CFX_SegmentedArray<PAGECHAR_INFO> PAGECHAR_InfoArray; |
| 41 typedef struct { | 41 typedef struct { |
| 42 int m_Start; | 42 int m_Start; |
| 43 int m_nCount; | 43 int m_nCount; |
| 44 } FPDF_SEGMENT; | 44 } FPDF_SEGMENT; |
| 45 typedef CFX_ArrayTemplate<FPDF_SEGMENT> SEGMENT_Array; | 45 typedef CFX_ArrayTemplate<FPDF_SEGMENT> SEGMENT_Array; |
| 46 typedef struct { | 46 typedef struct { |
| 47 CPDF_TextObject* m_pTextObj; | 47 CPDF_TextObject* m_pTextObj; |
| 48 CFX_AffineMatrix m_formMatrix; | 48 CFX_Matrix m_formMatrix; |
| 49 } PDFTEXT_Obj; | 49 } PDFTEXT_Obj; |
| 50 typedef CFX_ArrayTemplate<PDFTEXT_Obj> LINEOBJ; | 50 typedef CFX_ArrayTemplate<PDFTEXT_Obj> LINEOBJ; |
| 51 | 51 |
| 52 class CPDF_TextPage : public IPDF_TextPage { | 52 class CPDF_TextPage : public IPDF_TextPage { |
| 53 public: | 53 public: |
| 54 CPDF_TextPage(const CPDF_Page* pPage, int flags); | 54 CPDF_TextPage(const CPDF_Page* pPage, int flags); |
| 55 ~CPDF_TextPage() override {} | 55 ~CPDF_TextPage() override {} |
| 56 | 56 |
| 57 // IPDF_TextPage | 57 // IPDF_TextPage |
| 58 FX_BOOL ParseTextPage() override; | 58 FX_BOOL ParseTextPage() override; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, | 96 static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, |
| 97 const CFX_FloatRect& rect2); | 97 const CFX_FloatRect& rect2); |
| 98 static FX_BOOL IsLetter(FX_WCHAR unicode); | 98 static FX_BOOL IsLetter(FX_WCHAR unicode); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 FX_BOOL IsHyphen(FX_WCHAR curChar); | 101 FX_BOOL IsHyphen(FX_WCHAR curChar); |
| 102 bool IsControlChar(const PAGECHAR_INFO& charInfo); | 102 bool IsControlChar(const PAGECHAR_INFO& charInfo); |
| 103 FX_BOOL GetBaselineRotate(int start, int end, int& Rotate); | 103 FX_BOOL GetBaselineRotate(int start, int end, int& Rotate); |
| 104 void ProcessObject(); | 104 void ProcessObject(); |
| 105 void ProcessFormObject(CPDF_FormObject* pFormObj, | 105 void ProcessFormObject(CPDF_FormObject* pFormObj, |
| 106 const CFX_AffineMatrix& formMatrix); | 106 const CFX_Matrix& formMatrix); |
| 107 void ProcessTextObject(PDFTEXT_Obj pObj); | 107 void ProcessTextObject(PDFTEXT_Obj pObj); |
| 108 void ProcessTextObject(CPDF_TextObject* pTextObj, | 108 void ProcessTextObject(CPDF_TextObject* pTextObj, |
| 109 const CFX_AffineMatrix& formMatrix, | 109 const CFX_Matrix& formMatrix, |
| 110 FX_POSITION ObjPos); | 110 FX_POSITION ObjPos); |
| 111 int ProcessInsertObject(const CPDF_TextObject* pObj, | 111 int ProcessInsertObject(const CPDF_TextObject* pObj, |
| 112 const CFX_AffineMatrix& formMatrix); | 112 const CFX_Matrix& formMatrix); |
| 113 FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info); | 113 FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info); |
| 114 FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos); | 114 FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, FX_POSITION ObjPos); |
| 115 FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, | 115 FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, |
| 116 CPDF_TextObject* pTextObj2); | 116 CPDF_TextObject* pTextObj2); |
| 117 int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const; | 117 int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const; |
| 118 void CloseTempLine(); | 118 void CloseTempLine(); |
| 119 void OnPiece(CFX_BidiChar* pBidi, CFX_WideString& str); | 119 void OnPiece(CFX_BidiChar* pBidi, CFX_WideString& str); |
| 120 int32_t PreMarkedContent(PDFTEXT_Obj pObj); | 120 int32_t PreMarkedContent(PDFTEXT_Obj pObj); |
| 121 void ProcessMarkedContent(PDFTEXT_Obj pObj); | 121 void ProcessMarkedContent(PDFTEXT_Obj pObj); |
| 122 void CheckMarkedContentObject(int32_t& start, int32_t& nCount) const; | 122 void CheckMarkedContentObject(int32_t& start, int32_t& nCount) const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 133 | 133 |
| 134 CPDFText_ParseOptions m_ParseOptions; | 134 CPDFText_ParseOptions m_ParseOptions; |
| 135 CFX_WordArray m_CharIndex; | 135 CFX_WordArray m_CharIndex; |
| 136 const CPDF_PageObjects* const m_pPage; | 136 const CPDF_PageObjects* const m_pPage; |
| 137 PAGECHAR_InfoArray m_charList; | 137 PAGECHAR_InfoArray m_charList; |
| 138 CFX_WideTextBuf m_TextBuf; | 138 CFX_WideTextBuf m_TextBuf; |
| 139 PAGECHAR_InfoArray m_TempCharList; | 139 PAGECHAR_InfoArray m_TempCharList; |
| 140 CFX_WideTextBuf m_TempTextBuf; | 140 CFX_WideTextBuf m_TempTextBuf; |
| 141 const int m_parserflag; | 141 const int m_parserflag; |
| 142 CPDF_TextObject* m_pPreTextObj; | 142 CPDF_TextObject* m_pPreTextObj; |
| 143 CFX_AffineMatrix m_perMatrix; | 143 CFX_Matrix m_perMatrix; |
| 144 bool m_bIsParsed; | 144 bool m_bIsParsed; |
| 145 CFX_AffineMatrix m_DisplayMatrix; | 145 CFX_Matrix m_DisplayMatrix; |
| 146 SEGMENT_Array m_Segment; | 146 SEGMENT_Array m_Segment; |
| 147 CFX_RectArray m_SelRects; | 147 CFX_RectArray m_SelRects; |
| 148 LINEOBJ m_LineObj; | 148 LINEOBJ m_LineObj; |
| 149 int32_t m_TextlineDir; | 149 int32_t m_TextlineDir; |
| 150 CFX_FloatRect m_CurlineRect; | 150 CFX_FloatRect m_CurlineRect; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 class CPDF_TextPageFind : public IPDF_TextPageFind { | 153 class CPDF_TextPageFind : public IPDF_TextPageFind { |
| 154 public: | 154 public: |
| 155 explicit CPDF_TextPageFind(const IPDF_TextPage* pTextPage); | 155 explicit CPDF_TextPageFind(const IPDF_TextPage* pTextPage); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst); | 240 FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst); |
| 241 void NormalizeString(CFX_WideString& str); | 241 void NormalizeString(CFX_WideString& str); |
| 242 void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest); | 242 void NormalizeCompositeChar(FX_WCHAR wChar, CFX_WideString& sDest); |
| 243 void GetTextStream_Unicode(CFX_WideTextBuf& buffer, | 243 void GetTextStream_Unicode(CFX_WideTextBuf& buffer, |
| 244 CPDF_PageObjects* pPage, | 244 CPDF_PageObjects* pPage, |
| 245 FX_BOOL bUseLF, | 245 FX_BOOL bUseLF, |
| 246 CFX_PtrArray* pObjArray); | 246 CFX_PtrArray* pObjArray); |
| 247 | 247 |
| 248 #endif // CORE_SRC_FPDFTEXT_TEXT_INT_H_ | 248 #endif // CORE_SRC_FPDFTEXT_TEXT_INT_H_ |
| OLD | NEW |