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

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

Issue 2289293005: Use /RECT or /QuadPoints for annotation coordinates, depending on /AP (Closed)
Patch Set: Use /RECT or /QuadPoints for annotation coordinates, depending on /AP 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
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_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ 7 #ifndef CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_
8 #define CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ 8 #define CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 12
13 #include "core/fxcrt/include/fx_coordinates.h" 13 #include "core/fxcrt/include/fx_coordinates.h"
14 #include "core/fxcrt/include/fx_string.h" 14 #include "core/fxcrt/include/fx_string.h"
15 #include "core/fxcrt/include/fx_system.h" 15 #include "core/fxcrt/include/fx_system.h"
16 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
Lei Zhang 2016/09/01 21:13:00 Just forward declare. If you were keeping it, I w
tonikitoo 2016/09/01 21:50:42 Done.
16 17
17 class CFX_RenderDevice; 18 class CFX_RenderDevice;
18 class CPDF_Dictionary; 19 class CPDF_Dictionary;
19 class CPDF_Document; 20 class CPDF_Document;
20 class CPDF_Form; 21 class CPDF_Form;
21 class CPDF_Page; 22 class CPDF_Page;
22 class CPDF_RenderContext; 23 class CPDF_RenderContext;
23 class CPDF_RenderOptions; 24 class CPDF_RenderOptions;
24 class CPDF_Stream; 25 class CPDF_Stream;
25 26
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void DrawBorder(CFX_RenderDevice* pDevice, 94 void DrawBorder(CFX_RenderDevice* pDevice,
94 const CFX_Matrix* pUser2Device, 95 const CFX_Matrix* pUser2Device,
95 const CPDF_RenderOptions* pOptions); 96 const CPDF_RenderOptions* pOptions);
96 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode); 97 CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode);
97 void SetOpenState(bool bOpenState) { m_bOpenState = bOpenState; } 98 void SetOpenState(bool bOpenState) { m_bOpenState = bOpenState; }
98 CPDF_Annot* GetPopupAnnot() const { return m_pPopupAnnot; } 99 CPDF_Annot* GetPopupAnnot() const { return m_pPopupAnnot; }
99 void SetPopupAnnot(CPDF_Annot* pAnnot) { m_pPopupAnnot = pAnnot; } 100 void SetPopupAnnot(CPDF_Annot* pAnnot) { m_pPopupAnnot = pAnnot; }
100 101
101 private: 102 private:
102 void GenerateAPIfNeeded(); 103 void GenerateAPIfNeeded();
104 bool ShouldUseQuadPointsCoords(CPDF_Array*&) const;
Lei Zhang 2016/09/01 21:13:00 Please try not do add more parameters that pass by
tonikitoo 2016/09/01 21:50:41 Done.
103 105
104 CPDF_Dictionary* const m_pAnnotDict; 106 CPDF_Dictionary* const m_pAnnotDict;
105 CPDF_Document* const m_pDocument; 107 CPDF_Document* const m_pDocument;
106 CPDF_Annot::Subtype m_nSubtype; 108 CPDF_Annot::Subtype m_nSubtype;
107 std::map<CPDF_Stream*, std::unique_ptr<CPDF_Form>> m_APMap; 109 std::map<CPDF_Stream*, std::unique_ptr<CPDF_Form>> m_APMap;
108 // |m_bOpenState| is only set for popup annotations. 110 // |m_bOpenState| is only set for popup annotations.
109 bool m_bOpenState; 111 bool m_bOpenState;
112 bool m_bHasGeneratedAP;
110 // Not owned. If there is a valid pointer in |m_pPopupAnnot|, 113 // Not owned. If there is a valid pointer in |m_pPopupAnnot|,
111 // then this annot is never a popup. 114 // then this annot is never a popup.
112 CPDF_Annot* m_pPopupAnnot; 115 CPDF_Annot* m_pPopupAnnot;
113 }; 116 };
114 117
115 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, 118 CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict,
116 CPDF_Annot::AppearanceMode mode); 119 CPDF_Annot::AppearanceMode mode);
117 120
118 #endif // CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_ 121 #endif // CORE_FPDFDOC_INCLUDE_CPDF_ANNOT_H_
OLDNEW
« core/fpdfdoc/cpdf_annot.cpp ('K') | « core/fpdfdoc/cpvt_generateap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698