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

Side by Side Diff: core/include/fpdfdoc/fpdf_ap.h

Issue 1634123004: War on #defines - part 2 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Missing break Created 4 years, 10 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
OLDNEW
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_INCLUDE_FPDFDOC_FPDF_AP_H_ 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_AP_H_
8 #define CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ 8 #define CORE_INCLUDE_FPDFDOC_FPDF_AP_H_
9 9
10 #include "core/include/fpdfapi/fpdf_parser.h" 10 #include "core/include/fpdfapi/fpdf_parser.h"
11 #include "fpdf_vt.h" 11 #include "fpdf_vt.h"
12 12
13 class IPVT_FontMap { 13 class IPVT_FontMap {
14 public: 14 public:
15 virtual ~IPVT_FontMap() {} 15 virtual ~IPVT_FontMap() {}
16 virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0; 16 virtual CPDF_Font* GetPDFFont(int32_t nFontIndex) = 0;
17 virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0; 17 virtual CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) = 0;
18 }; 18 };
19
19 struct CPVT_Dash { 20 struct CPVT_Dash {
20 CPVT_Dash(int32_t dash, int32_t gap, int32_t phase) 21 CPVT_Dash(int32_t dash, int32_t gap, int32_t phase)
21 : nDash(dash), nGap(gap), nPhase(phase) {} 22 : nDash(dash), nGap(gap), nPhase(phase) {}
22 23
23 int32_t nDash; 24 int32_t nDash;
24
25 int32_t nGap; 25 int32_t nGap;
26
27 int32_t nPhase; 26 int32_t nPhase;
28 }; 27 };
29 #define CT_TRANSPARENT 0 28
30 #define CT_GRAY 1
31 #define CT_RGB 2
32 #define CT_CMYK 3
33 struct CPVT_Color { 29 struct CPVT_Color {
34 CPVT_Color(int32_t type = 0, 30 enum Type { TRANSPARENT = 0, GRAY, RGB, CMYK };
31
32 CPVT_Color(Type type = TRANSPARENT,
35 FX_FLOAT color1 = 0.0f, 33 FX_FLOAT color1 = 0.0f,
36 FX_FLOAT color2 = 0.0f, 34 FX_FLOAT color2 = 0.0f,
37 FX_FLOAT color3 = 0.0f, 35 FX_FLOAT color3 = 0.0f,
38 FX_FLOAT color4 = 0.0f) 36 FX_FLOAT color4 = 0.0f)
39 : nColorType(type), 37 : nColorType(type),
40 fColor1(color1), 38 fColor1(color1),
41 fColor2(color2), 39 fColor2(color2),
42 fColor3(color3), 40 fColor3(color3),
43 fColor4(color4) {} 41 fColor4(color4) {}
44 42
45 int32_t nColorType; 43 Type nColorType;
46 FX_FLOAT fColor1; 44 FX_FLOAT fColor1;
47 FX_FLOAT fColor2; 45 FX_FLOAT fColor2;
48 FX_FLOAT fColor3; 46 FX_FLOAT fColor3;
49 FX_FLOAT fColor4; 47 FX_FLOAT fColor4;
50 }; 48 };
49
51 class CPVT_Provider : public IPDF_VariableText_Provider { 50 class CPVT_Provider : public IPDF_VariableText_Provider {
52 public: 51 public:
53 CPVT_Provider(IPVT_FontMap* pFontMap); 52 CPVT_Provider(IPVT_FontMap* pFontMap);
54 ~CPVT_Provider() override; 53 ~CPVT_Provider() override;
55 54
56 // IPDF_VariableText_Provider 55 // IPDF_VariableText_Provider
57 int32_t GetCharWidth(int32_t nFontIndex, 56 int32_t GetCharWidth(int32_t nFontIndex,
58 FX_WORD word, 57 FX_WORD word,
59 int32_t nWordStyle) override; 58 int32_t nWordStyle) override;
60 int32_t GetTypeAscent(int32_t nFontIndex) override; 59 int32_t GetTypeAscent(int32_t nFontIndex) override;
61 int32_t GetTypeDescent(int32_t nFontIndex) override; 60 int32_t GetTypeDescent(int32_t nFontIndex) override;
62 int32_t GetWordFontIndex(FX_WORD word, 61 int32_t GetWordFontIndex(FX_WORD word,
63 int32_t charset, 62 int32_t charset,
64 int32_t nFontIndex) override; 63 int32_t nFontIndex) override;
65 FX_BOOL IsLatinWord(FX_WORD word) override; 64 FX_BOOL IsLatinWord(FX_WORD word) override;
66 int32_t GetDefaultFontIndex() override; 65 int32_t GetDefaultFontIndex() override;
67 66
68 private: 67 private:
69 IPVT_FontMap* m_pFontMap; 68 IPVT_FontMap* m_pFontMap;
70 }; 69 };
71 #define PBS_SOLID 0 70
72 #define PBS_DASH 1
73 #define PBS_BEVELED 2
74 #define PBS_INSET 3
75 #define PBS_UNDERLINED 4
76 class CPVT_GenerateAP { 71 class CPVT_GenerateAP {
77 public: 72 public:
78 static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc, 73 static FX_BOOL GenerateTextFieldAP(CPDF_Document* pDoc,
79 CPDF_Dictionary* pAnnotDict); 74 CPDF_Dictionary* pAnnotDict);
80 75
81 static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc, 76 static FX_BOOL GenerateComboBoxAP(CPDF_Document* pDoc,
82 CPDF_Dictionary* pAnnotDict); 77 CPDF_Dictionary* pAnnotDict);
83 78
84 static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc, 79 static FX_BOOL GenerateListBoxAP(CPDF_Document* pDoc,
85 CPDF_Dictionary* pAnnotDict); 80 CPDF_Dictionary* pAnnotDict);
(...skipping 11 matching lines...) Expand all
97 const CPVT_Color& crLeftTop, 92 const CPVT_Color& crLeftTop,
98 const CPVT_Color& crRightBottom, 93 const CPVT_Color& crRightBottom,
99 int32_t nStyle, 94 int32_t nStyle,
100 const CPVT_Dash& dash); 95 const CPVT_Dash& dash);
101 96
102 static CFX_ByteString GenerateColorAP(const CPVT_Color& color, 97 static CFX_ByteString GenerateColorAP(const CPVT_Color& color,
103 const FX_BOOL& bFillOrStroke); 98 const FX_BOOL& bFillOrStroke);
104 }; 99 };
105 100
106 #endif // CORE_INCLUDE_FPDFDOC_FPDF_AP_H_ 101 #endif // CORE_INCLUDE_FPDFDOC_FPDF_AP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698