| 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> |
| 11 #include <vector> |
| 11 | 12 |
| 12 #include "core/fxge/include/fx_dib.h" | 13 #include "core/fxge/include/fx_dib.h" |
| 13 #include "core/fxge/include/fx_ge.h" | 14 #include "core/fxge/include/fx_ge.h" |
| 14 #include "xfa/fde/fde_object.h" | 15 #include "xfa/fde/fde_object.h" |
| 15 #include "xfa/fgas/crt/fgas_utils.h" | 16 #include "xfa/fgas/crt/fgas_utils.h" |
| 16 #include "xfa/fgas/font/fgas_font.h" | 17 #include "xfa/fgas/font/fgas_font.h" |
| 17 | 18 |
| 18 #define FDE_TTOSTYLE_Underline 0x0001 | 19 #define FDE_TTOSTYLE_Underline 0x0001 |
| 19 #define FDE_TTOSTYLE_Strikeout 0x0002 | 20 #define FDE_TTOSTYLE_Strikeout 0x0002 |
| 20 #define FDE_TTOSTYLE_VerticalLayout 0x0004 | 21 #define FDE_TTOSTYLE_VerticalLayout 0x0004 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 FX_FLOAT& fWidth, | 125 FX_FLOAT& fWidth, |
| 125 FX_FLOAT& fHeight); | 126 FX_FLOAT& fHeight); |
| 126 void SetLineWidth(CFX_RectF& rect); | 127 void SetLineWidth(CFX_RectF& rect); |
| 127 void DrawText(const FX_WCHAR* pwsStr, | 128 void DrawText(const FX_WCHAR* pwsStr, |
| 128 int32_t iLength, | 129 int32_t iLength, |
| 129 const CFX_RectF& rect, | 130 const CFX_RectF& rect, |
| 130 const CFX_RectF& rtClip); | 131 const CFX_RectF& rtClip); |
| 131 void LoadText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect); | 132 void LoadText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect); |
| 132 void LoadEllipsis(); | 133 void LoadEllipsis(); |
| 133 void ExpandBuffer(int32_t iSize, int32_t iType); | 134 void ExpandBuffer(int32_t iSize, int32_t iType); |
| 134 void RetrieveEllPieces(int32_t*& pCharWidths); | 135 void RetrieveEllPieces(std::vector<int32_t>* pCharWidths); |
| 135 | 136 |
| 136 void Reload(const CFX_RectF& rect); | 137 void Reload(const CFX_RectF& rect); |
| 137 void ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect); | 138 void ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect); |
| 138 FX_BOOL RetriecePieces(uint32_t dwBreakStatus, | 139 FX_BOOL RetriecePieces(uint32_t dwBreakStatus, |
| 139 int32_t& iStartChar, | 140 int32_t& iStartChar, |
| 140 int32_t& iPieceWidths, | 141 int32_t& iPieceWidths, |
| 141 FX_BOOL bReload, | 142 FX_BOOL bReload, |
| 142 const CFX_RectF& rect); | 143 const CFX_RectF& rect); |
| 143 void AppendPiece(const FDE_TTOPIECE& ttoPiece, | 144 void AppendPiece(const FDE_TTOPIECE& ttoPiece, |
| 144 FX_BOOL bNeedReload, | 145 FX_BOOL bNeedReload, |
| 145 FX_BOOL bEnd); | 146 FX_BOOL bEnd); |
| 146 void ReplaceWidthEllipsis(); | 147 void ReplaceWidthEllipsis(); |
| 147 void DoAlignment(const CFX_RectF& rect); | 148 void DoAlignment(const CFX_RectF& rect); |
| 148 void OnDraw(const CFX_RectF& rtClip); | 149 void OnDraw(const CFX_RectF& rtClip); |
| 149 int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); | 150 int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); |
| 150 int32_t GetCharRects(const FDE_TTOPIECE* pPiece); | 151 int32_t GetCharRects(const FDE_TTOPIECE* pPiece); |
| 151 | 152 |
| 152 FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece); | 153 FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece); |
| 153 void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen); | 154 void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen); |
| 154 | 155 |
| 155 CFX_TxtBreak* m_pTxtBreak; | 156 std::unique_ptr<CFX_TxtBreak> m_pTxtBreak; |
| 156 CFGAS_GEFont* m_pFont; | 157 CFGAS_GEFont* m_pFont; // not owned. |
| 157 FX_FLOAT m_fFontSize; | 158 FX_FLOAT m_fFontSize; |
| 158 FX_FLOAT m_fLineSpace; | 159 FX_FLOAT m_fLineSpace; |
| 159 FX_FLOAT m_fLinePos; | 160 FX_FLOAT m_fLinePos; |
| 160 FX_FLOAT m_fTolerance; | 161 FX_FLOAT m_fTolerance; |
| 161 int32_t m_iAlignment; | 162 int32_t m_iAlignment; |
| 162 int32_t m_iTxtBkAlignment; | 163 int32_t m_iTxtBkAlignment; |
| 163 int32_t* m_pCharWidths; | 164 std::vector<int32_t> m_CharWidths; |
| 164 int32_t m_iChars; | 165 std::vector<int32_t> m_EllCharWidths; |
| 165 int32_t* m_pEllCharWidths; | |
| 166 int32_t m_iEllChars; | |
| 167 FX_WCHAR m_wParagraphBkChar; | 166 FX_WCHAR m_wParagraphBkChar; |
| 168 FX_ARGB m_TxtColor; | 167 FX_ARGB m_TxtColor; |
| 169 uint32_t m_dwStyles; | 168 uint32_t m_dwStyles; |
| 170 uint32_t m_dwTxtBkStyles; | 169 uint32_t m_dwTxtBkStyles; |
| 171 CFX_WideString m_wsEllipsis; | 170 CFX_WideString m_wsEllipsis; |
| 172 FX_BOOL m_bElliChanged; | 171 FX_BOOL m_bElliChanged; |
| 173 int32_t m_iEllipsisWidth; | 172 int32_t m_iEllipsisWidth; |
| 174 CFX_WideString m_wsText; | 173 CFX_WideString m_wsText; |
| 175 CFX_RectF m_rtClip; | 174 CFX_RectF m_rtClip; |
| 176 CFX_RectF m_rtLogicClip; | 175 CFX_RectF m_rtLogicClip; |
| 177 CFX_Matrix m_Matrix; | 176 CFX_Matrix m_Matrix; |
| 178 CFDE_TTOLineArray m_ttoLines; | 177 CFDE_TTOLineArray m_ttoLines; |
| 179 int32_t m_iCurLine; | 178 int32_t m_iCurLine; |
| 180 int32_t m_iCurPiece; | 179 int32_t m_iCurPiece; |
| 181 int32_t m_iTotalLines; | 180 int32_t m_iTotalLines; |
| 182 FXTEXT_CHARPOS* m_pCharPos; | 181 std::vector<FXTEXT_CHARPOS> m_CharPos; |
| 183 int32_t m_iCharPosSize; | |
| 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 |