| 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/cpdfsdk_baannothandler.h" | 7 #include "fpdfsdk/cpdfsdk_baannothandler.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 CPDFSDK_Annot* CPDFSDK_BAAnnotHandler::NewAnnot(CXFA_FFWidget* hWidget, | 50 CPDFSDK_Annot* CPDFSDK_BAAnnotHandler::NewAnnot(CXFA_FFWidget* hWidget, |
| 51 CPDFSDK_PageView* pPage) { | 51 CPDFSDK_PageView* pPage) { |
| 52 return nullptr; | 52 return nullptr; |
| 53 } | 53 } |
| 54 #endif // PDF_ENABLE_XFA | 54 #endif // PDF_ENABLE_XFA |
| 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) {} | |
| 61 | |
| 62 void CPDFSDK_BAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 60 void CPDFSDK_BAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
| 63 CPDFSDK_Annot* pAnnot, | 61 CPDFSDK_Annot* pAnnot, |
| 64 CFX_RenderDevice* pDevice, | 62 CFX_RenderDevice* pDevice, |
| 65 CFX_Matrix* pUser2Device, | 63 CFX_Matrix* pUser2Device, |
| 66 bool bDrawAnnots) { | 64 bool bDrawAnnots) { |
| 67 #ifdef PDF_ENABLE_XFA | 65 #ifdef PDF_ENABLE_XFA |
| 68 if (pAnnot->IsXFAField()) | 66 if (pAnnot->IsXFAField()) |
| 69 return; | 67 return; |
| 70 #endif // PDF_ENABLE_XFA | 68 #endif // PDF_ENABLE_XFA |
| 71 if (bDrawAnnots && pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::POPUP) { | 69 if (bDrawAnnots && pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::POPUP) { |
| 72 static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( | 70 static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( |
| 73 pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 71 pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
| 74 } | 72 } |
| 75 } | 73 } |
| 76 | 74 |
| 77 void CPDFSDK_BAAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} | |
| 78 | |
| 79 void CPDFSDK_BAAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {} | |
| 80 | |
| 81 void CPDFSDK_BAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, | 75 void CPDFSDK_BAAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 82 CPDFSDK_Annot::ObservedPtr* pAnnot, | 76 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 83 uint32_t nFlag) { | 77 uint32_t nFlag) { |
| 84 CPDFSDK_BAAnnot* pBAAnnot = static_cast<CPDFSDK_BAAnnot*>(pAnnot->Get()); | 78 CPDFSDK_BAAnnot* pBAAnnot = static_cast<CPDFSDK_BAAnnot*>(pAnnot->Get()); |
| 85 pBAAnnot->SetOpenState(true); | 79 pBAAnnot->SetOpenState(true); |
| 86 UpdateAnnotRects(pPageView, pBAAnnot); | 80 UpdateAnnotRects(pPageView, pBAAnnot); |
| 87 } | 81 } |
| 88 | 82 |
| 89 void CPDFSDK_BAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, | 83 void CPDFSDK_BAAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, |
| 90 CPDFSDK_Annot::ObservedPtr* pAnnot, | 84 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 int nFlag) { | 160 int nFlag) { |
| 167 return FALSE; | 161 return FALSE; |
| 168 } | 162 } |
| 169 | 163 |
| 170 FX_BOOL CPDFSDK_BAAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, | 164 FX_BOOL CPDFSDK_BAAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, |
| 171 int nKeyCode, | 165 int nKeyCode, |
| 172 int nFlag) { | 166 int nFlag) { |
| 173 return FALSE; | 167 return FALSE; |
| 174 } | 168 } |
| 175 | 169 |
| 176 void CPDFSDK_BAAnnotHandler::OnDeSelected(CPDFSDK_Annot* pAnnot) {} | |
| 177 | |
| 178 void CPDFSDK_BAAnnotHandler::OnSelected(CPDFSDK_Annot* pAnnot) {} | |
| 179 | |
| 180 void CPDFSDK_BAAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) {} | |
| 181 | |
| 182 void CPDFSDK_BAAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) {} | 170 void CPDFSDK_BAAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) {} |
| 183 | 171 |
| 184 FX_BOOL CPDFSDK_BAAnnotHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | 172 FX_BOOL CPDFSDK_BAAnnotHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 185 uint32_t nFlag) { | 173 uint32_t nFlag) { |
| 186 return FALSE; | 174 return FALSE; |
| 187 } | 175 } |
| 188 | 176 |
| 189 FX_BOOL CPDFSDK_BAAnnotHandler::OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, | 177 FX_BOOL CPDFSDK_BAAnnotHandler::OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 190 uint32_t nFlag) { | 178 uint32_t nFlag) { |
| 191 return FALSE; | 179 return FALSE; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 206 | 194 |
| 207 FX_BOOL CPDFSDK_BAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, | 195 FX_BOOL CPDFSDK_BAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, |
| 208 CPDFSDK_Annot* pAnnot, | 196 CPDFSDK_Annot* pAnnot, |
| 209 const CFX_FloatPoint& point) { | 197 const CFX_FloatPoint& point) { |
| 210 ASSERT(pPageView); | 198 ASSERT(pPageView); |
| 211 ASSERT(pAnnot); | 199 ASSERT(pAnnot); |
| 212 | 200 |
| 213 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); | 201 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); |
| 214 return rect.Contains(point.x, point.y); | 202 return rect.Contains(point.x, point.y); |
| 215 } | 203 } |
| OLD | NEW |