OLD | NEW |
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 #include "core/fpdfdoc/cpdf_annotlist.h" | 7 #include "core/fpdfdoc/cpdf_annotlist.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 if (pPopupAnnot) | 94 if (pPopupAnnot) |
95 m_AnnotList.push_back(std::move(pPopupAnnot)); | 95 m_AnnotList.push_back(std::move(pPopupAnnot)); |
96 } | 96 } |
97 } | 97 } |
98 | 98 |
99 CPDF_AnnotList::~CPDF_AnnotList() {} | 99 CPDF_AnnotList::~CPDF_AnnotList() {} |
100 | 100 |
101 void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, | 101 void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, |
102 CFX_RenderDevice* pDevice, | 102 CFX_RenderDevice* pDevice, |
103 CPDF_RenderContext* pContext, | 103 CPDF_RenderContext* pContext, |
104 FX_BOOL bPrinting, | 104 bool bPrinting, |
105 CFX_Matrix* pMatrix, | 105 CFX_Matrix* pMatrix, |
106 FX_BOOL bWidgetPass, | 106 bool bWidgetPass, |
107 CPDF_RenderOptions* pOptions, | 107 CPDF_RenderOptions* pOptions, |
108 FX_RECT* clip_rect) { | 108 FX_RECT* clip_rect) { |
109 for (const auto& pAnnot : m_AnnotList) { | 109 for (const auto& pAnnot : m_AnnotList) { |
110 bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET; | 110 bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET; |
111 if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) | 111 if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) |
112 continue; | 112 continue; |
113 | 113 |
114 uint32_t annot_flags = pAnnot->GetFlags(); | 114 uint32_t annot_flags = pAnnot->GetFlags(); |
115 if (annot_flags & ANNOTFLAG_HIDDEN) | 115 if (annot_flags & ANNOTFLAG_HIDDEN) |
116 continue; | 116 continue; |
(...skipping 27 matching lines...) Expand all Loading... |
144 } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix, | 144 } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix, |
145 CPDF_Annot::Normal, pOptions)) { | 145 CPDF_Annot::Normal, pOptions)) { |
146 pAnnot->DrawBorder(pDevice, &matrix, pOptions); | 146 pAnnot->DrawBorder(pDevice, &matrix, pOptions); |
147 } | 147 } |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, | 151 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, |
152 CFX_RenderDevice* pDevice, | 152 CFX_RenderDevice* pDevice, |
153 CPDF_RenderContext* pContext, | 153 CPDF_RenderContext* pContext, |
154 FX_BOOL bPrinting, | 154 bool bPrinting, |
155 CFX_Matrix* pUser2Device, | 155 CFX_Matrix* pUser2Device, |
156 uint32_t dwAnnotFlags, | 156 uint32_t dwAnnotFlags, |
157 CPDF_RenderOptions* pOptions, | 157 CPDF_RenderOptions* pOptions, |
158 FX_RECT* pClipRect) { | 158 FX_RECT* pClipRect) { |
159 if (dwAnnotFlags & ANNOTFLAG_INVISIBLE) { | 159 if (dwAnnotFlags & ANNOTFLAG_INVISIBLE) { |
160 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, FALSE, | 160 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, false, |
161 pOptions, pClipRect); | 161 pOptions, pClipRect); |
162 } | 162 } |
163 if (dwAnnotFlags & ANNOTFLAG_HIDDEN) { | 163 if (dwAnnotFlags & ANNOTFLAG_HIDDEN) { |
164 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, TRUE, | 164 DisplayPass(pPage, pDevice, pContext, bPrinting, pUser2Device, true, |
165 pOptions, pClipRect); | 165 pOptions, pClipRect); |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, | 169 void CPDF_AnnotList::DisplayAnnots(CPDF_Page* pPage, |
170 CPDF_RenderContext* pContext, | 170 CPDF_RenderContext* pContext, |
171 FX_BOOL bPrinting, | 171 bool bPrinting, |
172 CFX_Matrix* pMatrix, | 172 CFX_Matrix* pMatrix, |
173 FX_BOOL bShowWidget, | 173 bool bShowWidget, |
174 CPDF_RenderOptions* pOptions) { | 174 CPDF_RenderOptions* pOptions) { |
175 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN | 175 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN |
176 : ANNOTFLAG_INVISIBLE; | 176 : ANNOTFLAG_INVISIBLE; |
177 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, | 177 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, |
178 pOptions, nullptr); | 178 pOptions, nullptr); |
179 } | 179 } |
OLD | NEW |