Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: core/fpdfapi/fpdf_page/cpdf_textstate.h

Issue 2287313004: Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@moar_better_constness
Patch Set: Casts, Casts, New -> Emplace. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_textobject.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_textstate.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_ 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_
8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_ 8 #define CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_
9 9
10 #include "core/fpdfapi/fpdf_page/include/cpdf_textstatedata.h" 10 #include "core/fpdfapi/fpdf_page/include/cpdf_textstatedata.h"
11 #include "core/fxcrt/include/cfx_count_ref.h"
11 #include "core/fxcrt/include/fx_basic.h" 12 #include "core/fxcrt/include/fx_basic.h"
12 13
13 class CPDF_Font; 14 class CPDF_Font;
14 15
15 class CPDF_TextState : public CFX_CountRef<CPDF_TextStateData> { 16 class CPDF_TextState {
16 public: 17 public:
17 CPDF_Font* GetFont() const { return GetObject()->m_pFont; } 18 CPDF_TextState();
19 ~CPDF_TextState();
20
21 void Emplace();
22
23 CPDF_Font* GetFont() const;
18 void SetFont(CPDF_Font* pFont); 24 void SetFont(CPDF_Font* pFont);
19 25
20 FX_FLOAT GetFontSize() const { return GetObject()->m_FontSize; } 26 FX_FLOAT GetFontSize() const;
21 const FX_FLOAT* GetMatrix() const { return GetObject()->m_Matrix; } 27 void SetFontSize(FX_FLOAT size);
22 FX_FLOAT* GetMutableMatrix() { return GetPrivateCopy()->m_Matrix; } 28
29 const FX_FLOAT* GetMatrix() const;
30 FX_FLOAT* GetMutableMatrix();
31
32 FX_FLOAT GetCharSpace() const;
33 void SetCharSpace(FX_FLOAT sp);
34
35 FX_FLOAT GetWordSpace() const;
36 void SetWordSpace(FX_FLOAT sp);
23 37
24 FX_FLOAT GetFontSizeV() const; 38 FX_FLOAT GetFontSizeV() const;
25 FX_FLOAT GetFontSizeH() const; 39 FX_FLOAT GetFontSizeH() const;
26 FX_FLOAT GetBaselineAngle() const; 40 FX_FLOAT GetBaselineAngle() const;
27 FX_FLOAT GetShearAngle() const; 41 FX_FLOAT GetShearAngle() const;
42
43 TextRenderingMode GetTextMode() const;
44 void SetTextMode(TextRenderingMode mode);
45
46 const FX_FLOAT* GetCTM() const;
47 FX_FLOAT* GetMutableCTM();
48
49 private:
50 CFX_CountRef<CPDF_TextStateData> m_Ref;
28 }; 51 };
29 52
30 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_ 53 #endif // CORE_FPDFAPI_FPDF_PAGE_CPDF_TEXTSTATE_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_page/cpdf_textobject.cpp ('k') | core/fpdfapi/fpdf_page/cpdf_textstate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698