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 "fpdfsdk/include/cpdfsdk_baannothandler.h" | 7 #include "fpdfsdk/include/cpdfsdk_baannothandler.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 void CPDFSDK_BAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { | 56 void CPDFSDK_BAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { |
57 delete pAnnot; | 57 delete pAnnot; |
58 } | 58 } |
59 | 59 |
60 void CPDFSDK_BAAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} | 60 void CPDFSDK_BAAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} |
61 | 61 |
62 void CPDFSDK_BAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 62 void CPDFSDK_BAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
63 CPDFSDK_Annot* pAnnot, | 63 CPDFSDK_Annot* pAnnot, |
64 CFX_RenderDevice* pDevice, | 64 CFX_RenderDevice* pDevice, |
65 CFX_Matrix* pUser2Device) { | 65 CFX_Matrix* pUser2Device, |
| 66 bool bDrawAnnots) { |
66 #ifdef PDF_ENABLE_XFA | 67 #ifdef PDF_ENABLE_XFA |
67 if (pAnnot->IsXFAField()) | 68 if (pAnnot->IsXFAField()) |
68 return; | 69 return; |
69 #endif // PDF_ENABLE_XFA | 70 #endif // PDF_ENABLE_XFA |
70 static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( | 71 if (bDrawAnnots && pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::POPUP) { |
71 pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 72 static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( |
| 73 pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
| 74 } |
72 } | 75 } |
73 | 76 |
74 void CPDFSDK_BAAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} | 77 void CPDFSDK_BAAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} |
75 | 78 |
76 void CPDFSDK_BAAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {} | 79 void CPDFSDK_BAAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {} |
77 | 80 |
78 void CPDFSDK_BAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, | 81 void CPDFSDK_BAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
79 CPDFSDK_Annot* pAnnot, | 82 CPDFSDK_Annot* pAnnot, |
80 uint32_t nFlag) { | 83 uint32_t nFlag) { |
81 CPDFSDK_BAAnnot* pBAAnnot = static_cast<CPDFSDK_BAAnnot*>(pAnnot); | 84 CPDFSDK_BAAnnot* pBAAnnot = static_cast<CPDFSDK_BAAnnot*>(pAnnot); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 201 |
199 FX_BOOL CPDFSDK_BAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, | 202 FX_BOOL CPDFSDK_BAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, |
200 CPDFSDK_Annot* pAnnot, | 203 CPDFSDK_Annot* pAnnot, |
201 const CFX_FloatPoint& point) { | 204 const CFX_FloatPoint& point) { |
202 ASSERT(pPageView); | 205 ASSERT(pPageView); |
203 ASSERT(pAnnot); | 206 ASSERT(pAnnot); |
204 | 207 |
205 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); | 208 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); |
206 return rect.Contains(point.x, point.y); | 209 return rect.Contains(point.x, point.y); |
207 } | 210 } |
OLD | NEW |