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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 protected: | 72 protected: |
73 int32_t m_iPieceCount; | 73 int32_t m_iPieceCount; |
74 }; | 74 }; |
75 typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray; | 75 typedef CFX_ObjectMassArrayTemplate<CFDE_TTOLine> CFDE_TTOLineArray; |
76 | 76 |
77 class CFDE_TextOut : public CFX_Target { | 77 class CFDE_TextOut : public CFX_Target { |
78 public: | 78 public: |
79 CFDE_TextOut(); | 79 CFDE_TextOut(); |
80 ~CFDE_TextOut() override; | 80 ~CFDE_TextOut() override; |
81 | 81 |
82 void SetFont(CFGAS_GEFont* pFont); | 82 void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont); |
83 void SetFontSize(FX_FLOAT fFontSize); | 83 void SetFontSize(FX_FLOAT fFontSize); |
84 void SetTextColor(FX_ARGB color); | 84 void SetTextColor(FX_ARGB color); |
85 void SetStyles(uint32_t dwStyles); | 85 void SetStyles(uint32_t dwStyles); |
86 void SetTabWidth(FX_FLOAT fTabWidth); | 86 void SetTabWidth(FX_FLOAT fTabWidth); |
87 void SetEllipsisString(const CFX_WideString& wsEllipsis); | 87 void SetEllipsisString(const CFX_WideString& wsEllipsis); |
88 void SetParagraphBreakChar(FX_WCHAR wch); | 88 void SetParagraphBreakChar(FX_WCHAR wch); |
89 void SetAlignment(int32_t iAlignment); | 89 void SetAlignment(int32_t iAlignment); |
90 void SetLineSpace(FX_FLOAT fLineSpace); | 90 void SetLineSpace(FX_FLOAT fLineSpace); |
91 void SetDIBitmap(CFX_DIBitmap* pDIB); | 91 void SetDIBitmap(CFX_DIBitmap* pDIB); |
92 void SetRenderDevice(CFX_RenderDevice* pDevice); | 92 void SetRenderDevice(CFX_RenderDevice* pDevice); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void ReplaceWidthEllipsis(); | 146 void ReplaceWidthEllipsis(); |
147 void DoAlignment(const CFX_RectF& rect); | 147 void DoAlignment(const CFX_RectF& rect); |
148 void OnDraw(const CFX_RectF& rtClip); | 148 void OnDraw(const CFX_RectF& rtClip); |
149 int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); | 149 int32_t GetDisplayPos(FDE_TTOPIECE* pPiece); |
150 int32_t GetCharRects(const FDE_TTOPIECE* pPiece); | 150 int32_t GetCharRects(const FDE_TTOPIECE* pPiece); |
151 | 151 |
152 FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece); | 152 FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece); |
153 void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen); | 153 void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen); |
154 | 154 |
155 std::unique_ptr<CFX_TxtBreak> m_pTxtBreak; | 155 std::unique_ptr<CFX_TxtBreak> m_pTxtBreak; |
156 CFGAS_GEFont* m_pFont; // not owned. | 156 CFX_RetainPtr<CFGAS_GEFont> m_pFont; |
157 FX_FLOAT m_fFontSize; | 157 FX_FLOAT m_fFontSize; |
158 FX_FLOAT m_fLineSpace; | 158 FX_FLOAT m_fLineSpace; |
159 FX_FLOAT m_fLinePos; | 159 FX_FLOAT m_fLinePos; |
160 FX_FLOAT m_fTolerance; | 160 FX_FLOAT m_fTolerance; |
161 int32_t m_iAlignment; | 161 int32_t m_iAlignment; |
162 int32_t m_iTxtBkAlignment; | 162 int32_t m_iTxtBkAlignment; |
163 std::vector<int32_t> m_CharWidths; | 163 std::vector<int32_t> m_CharWidths; |
164 std::vector<int32_t> m_EllCharWidths; | 164 std::vector<int32_t> m_EllCharWidths; |
165 FX_WCHAR m_wParagraphBkChar; | 165 FX_WCHAR m_wParagraphBkChar; |
166 FX_ARGB m_TxtColor; | 166 FX_ARGB m_TxtColor; |
(...skipping 10 matching lines...) Expand all Loading... |
177 int32_t m_iCurLine; | 177 int32_t m_iCurLine; |
178 int32_t m_iCurPiece; | 178 int32_t m_iCurPiece; |
179 int32_t m_iTotalLines; | 179 int32_t m_iTotalLines; |
180 std::vector<FXTEXT_CHARPOS> m_CharPos; | 180 std::vector<FXTEXT_CHARPOS> m_CharPos; |
181 std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice; | 181 std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice; |
182 CFX_Int32Array m_hotKeys; | 182 CFX_Int32Array m_hotKeys; |
183 CFX_RectFArray m_rectArray; | 183 CFX_RectFArray m_rectArray; |
184 }; | 184 }; |
185 | 185 |
186 #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_ | 186 #endif // XFA_FDE_TTO_FDE_TEXTOUT_H_ |
OLD | NEW |