| 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 XFA_FDE_TTO_FDE_TEXTOUT_H_ | 7 #ifndef XFA_FDE_TTO_FDE_TEXTOUT_H_ |
| 8 #define XFA_FDE_TTO_FDE_TEXTOUT_H_ | 8 #define XFA_FDE_TTO_FDE_TEXTOUT_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class CFDE_TTOLine : public CFX_Target { | 58 class CFDE_TTOLine : public CFX_Target { |
| 59 public: | 59 public: |
| 60 CFDE_TTOLine(); | 60 CFDE_TTOLine(); |
| 61 CFDE_TTOLine(const CFDE_TTOLine& ttoLine); | 61 CFDE_TTOLine(const CFDE_TTOLine& ttoLine); |
| 62 ~CFDE_TTOLine() override; | 62 ~CFDE_TTOLine() override; |
| 63 | 63 |
| 64 int32_t AddPiece(int32_t index, const FDE_TTOPIECE& ttoPiece); | 64 int32_t AddPiece(int32_t index, const FDE_TTOPIECE& ttoPiece); |
| 65 int32_t GetSize() const; | 65 int32_t GetSize() const; |
| 66 FDE_TTOPIECE* GetPtrAt(int32_t index); | 66 FDE_TTOPIECE* GetPtrAt(int32_t index); |
| 67 void RemoveLast(int32_t iCount); | 67 void RemoveLast(int32_t iCount); |
| 68 void RemoveAll(FX_BOOL bLeaveMemory); | 68 void RemoveAll(bool bLeaveMemory); |
| 69 | 69 |
| 70 FX_BOOL m_bNewReload; | 70 bool m_bNewReload; |
| 71 CFDE_TTOPieceArray m_pieces; | 71 CFDE_TTOPieceArray m_pieces; |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 int32_t m_iPieceCount; | 74 int32_t m_iPieceCount; |
| 75 }; | 75 }; |
| 76 typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray; | 76 typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray; |
| 77 | 77 |
| 78 class CFDE_TextOut : public CFX_Target { | 78 class CFDE_TextOut : public CFX_Target { |
| 79 public: | 79 public: |
| 80 CFDE_TextOut(); | 80 CFDE_TextOut(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 int32_t iLength, | 115 int32_t iLength, |
| 116 FX_FLOAT x, | 116 FX_FLOAT x, |
| 117 FX_FLOAT y); | 117 FX_FLOAT y); |
| 118 void DrawLogicText(const FX_WCHAR* pwsStr, | 118 void DrawLogicText(const FX_WCHAR* pwsStr, |
| 119 int32_t iLength, | 119 int32_t iLength, |
| 120 const CFX_RectF& rect); | 120 const CFX_RectF& rect); |
| 121 int32_t GetTotalLines(); | 121 int32_t GetTotalLines(); |
| 122 | 122 |
| 123 protected: | 123 protected: |
| 124 void CalcTextSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_RectF& rect); | 124 void CalcTextSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_RectF& rect); |
| 125 FX_BOOL RetrieveLineWidth(uint32_t dwBreakStatus, | 125 bool RetrieveLineWidth(uint32_t dwBreakStatus, |
| 126 FX_FLOAT& fStartPos, | 126 FX_FLOAT& fStartPos, |
| 127 FX_FLOAT& fWidth, | 127 FX_FLOAT& fWidth, |
| 128 FX_FLOAT& fHeight); | 128 FX_FLOAT& fHeight); |
| 129 void SetLineWidth(CFX_RectF& rect); | 129 void SetLineWidth(CFX_RectF& rect); |
| 130 void DrawText(const FX_WCHAR* pwsStr, | 130 void DrawText(const FX_WCHAR* pwsStr, |
| 131 int32_t iLength, | 131 int32_t iLength, |
| 132 const CFX_RectF& rect, | 132 const CFX_RectF& rect, |
| 133 const CFX_RectF& rtClip); | 133 const CFX_RectF& rtClip); |
| 134 void LoadText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect); | 134 void LoadText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect); |
| 135 void LoadEllipsis(); | 135 void LoadEllipsis(); |
| 136 void ExpandBuffer(int32_t iSize, int32_t iType); | 136 void ExpandBuffer(int32_t iSize, int32_t iType); |
| 137 void RetrieveEllPieces(std::vector<int32_t>* pCharWidths); | 137 void RetrieveEllPieces(std::vector<int32_t>* pCharWidths); |
| 138 | 138 |
| 139 void Reload(const CFX_RectF& rect); | 139 void Reload(const CFX_RectF& rect); |
| 140 void ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect); | 140 void ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect); |
| 141 FX_BOOL RetriecePieces(uint32_t dwBreakStatus, | 141 bool RetriecePieces(uint32_t dwBreakStatus, |
| 142 int32_t& iStartChar, | 142 int32_t& iStartChar, |
| 143 int32_t& iPieceWidths, | 143 int32_t& iPieceWidths, |
| 144 FX_BOOL bReload, | 144 bool bReload, |
| 145 const CFX_RectF& rect); | 145 const CFX_RectF& rect); |
| 146 void AppendPiece(const FDE_TTOPIECE& ttoPiece, | 146 void AppendPiece(const FDE_TTOPIECE& ttoPiece, bool bNeedReload, bool bEnd); |
| 147 FX_BOOL bNeedReload, | |
| 148 FX_BOOL bEnd); | |
| 149 void ReplaceWidthEllipsis(); | 147 void ReplaceWidthEllipsis(); |
| 150 void DoAlignment(const CFX_RectF& rect); | 148 void DoAlignment(const CFX_RectF& rect); |
| 151 void OnDraw(const CFX_RectF& rtClip); | 149 void OnDraw(const CFX_RectF& rtClip); |
| 152 int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); | 150 int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); |
| 153 int32_t GetCharRects(const FDE_TTOPIECE* pPiece); | 151 int32_t GetCharRects(const FDE_TTOPIECE* pPiece); |
| 154 | 152 |
| 155 FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece); | 153 FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece); |
| 156 void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen); | 154 void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen); |
| 157 | 155 |
| 158 std::unique_ptr<CFX_TxtBreak> m_pTxtBreak; | 156 std::unique_ptr<CFX_TxtBreak> m_pTxtBreak; |
| 159 CFGAS_GEFont* m_pFont; // not owned. | 157 CFGAS_GEFont* m_pFont; // not owned. |
| 160 FX_FLOAT m_fFontSize; | 158 FX_FLOAT m_fFontSize; |
| 161 FX_FLOAT m_fLineSpace; | 159 FX_FLOAT m_fLineSpace; |
| 162 FX_FLOAT m_fLinePos; | 160 FX_FLOAT m_fLinePos; |
| 163 FX_FLOAT m_fTolerance; | 161 FX_FLOAT m_fTolerance; |
| 164 int32_t m_iAlignment; | 162 int32_t m_iAlignment; |
| 165 int32_t m_iTxtBkAlignment; | 163 int32_t m_iTxtBkAlignment; |
| 166 std::vector<int32_t> m_CharWidths; | 164 std::vector<int32_t> m_CharWidths; |
| 167 std::vector<int32_t> m_EllCharWidths; | 165 std::vector<int32_t> m_EllCharWidths; |
| 168 FX_WCHAR m_wParagraphBkChar; | 166 FX_WCHAR m_wParagraphBkChar; |
| 169 FX_ARGB m_TxtColor; | 167 FX_ARGB m_TxtColor; |
| 170 uint32_t m_dwStyles; | 168 uint32_t m_dwStyles; |
| 171 uint32_t m_dwTxtBkStyles; | 169 uint32_t m_dwTxtBkStyles; |
| 172 CFX_WideString m_wsEllipsis; | 170 CFX_WideString m_wsEllipsis; |
| 173 FX_BOOL m_bElliChanged; | 171 bool m_bElliChanged; |
| 174 int32_t m_iEllipsisWidth; | 172 int32_t m_iEllipsisWidth; |
| 175 CFX_WideString m_wsText; | 173 CFX_WideString m_wsText; |
| 176 CFX_RectF m_rtClip; | 174 CFX_RectF m_rtClip; |
| 177 CFX_RectF m_rtLogicClip; | 175 CFX_RectF m_rtLogicClip; |
| 178 CFX_Matrix m_Matrix; | 176 CFX_Matrix m_Matrix; |
| 179 CFDE_TTOLineArray m_ttoLines; | 177 CFDE_TTOLineArray m_ttoLines; |
| 180 int32_t m_iCurLine; | 178 int32_t m_iCurLine; |
| 181 int32_t m_iCurPiece; | 179 int32_t m_iCurPiece; |
| 182 int32_t m_iTotalLines; | 180 int32_t m_iTotalLines; |
| 183 std::vector<FXTEXT_CHARPOS> m_CharPos; | 181 std::vector<FXTEXT_CHARPOS> m_CharPos; |
| 184 std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice; | 182 std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice; |
| 185 CFX_Int32Array m_hotKeys; | 183 CFX_Int32Array m_hotKeys; |
| 186 CFX_RectFArray m_rectArray; | 184 CFX_RectFArray m_rectArray; |
| 187 }; | 185 }; |
| 188 | 186 |
| 189 #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_ | 187 #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_ |
| OLD | NEW |