OLD | NEW |
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 #include "fpdfsdk/include/fsdk_mgr.h" | 7 #include "fpdfsdk/include/fsdk_mgr.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 12 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
13 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
14 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 14 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 15 #include "core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h" |
15 #include "core/fpdfdoc/include/cpdf_docjsactions.h" | 16 #include "core/fpdfdoc/include/cpdf_docjsactions.h" |
16 #include "core/fpdfdoc/include/cpdf_interform.h" | 17 #include "core/fpdfdoc/include/cpdf_interform.h" |
17 #include "core/fxcrt/include/cfx_retain_ptr.h" | 18 #include "core/fxcrt/include/cfx_retain_ptr.h" |
18 #include "core/fxge/include/cfx_renderdevice.h" | 19 #include "core/fxge/include/cfx_renderdevice.h" |
19 #include "fpdfsdk/formfiller/cffl_formfiller.h" | 20 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
20 #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" | 21 #include "fpdfsdk/include/cpdfsdk_annothandlermgr.h" |
21 #include "fpdfsdk/include/cpdfsdk_annotiterator.h" | 22 #include "fpdfsdk/include/cpdfsdk_annotiterator.h" |
22 #include "fpdfsdk/include/cpdfsdk_interform.h" | 23 #include "fpdfsdk/include/cpdfsdk_interform.h" |
23 #include "fpdfsdk/include/cpdfsdk_widget.h" | 24 #include "fpdfsdk/include/cpdfsdk_widget.h" |
24 #include "fpdfsdk/include/fsdk_define.h" | 25 #include "fpdfsdk/include/fsdk_define.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 docView->GetWidgetHandler()->RenderWidget(annot->GetXFAWidget(), &gs, | 575 docView->GetWidgetHandler()->RenderWidget(annot->GetXFAWidget(), &gs, |
575 pUser2Device, FALSE); | 576 pUser2Device, FALSE); |
576 return; | 577 return; |
577 } | 578 } |
578 #endif // PDF_ENABLE_XFA | 579 #endif // PDF_ENABLE_XFA |
579 | 580 |
580 // for pdf/static xfa. | 581 // for pdf/static xfa. |
581 CPDFSDK_AnnotIterator annotIterator(this, true); | 582 CPDFSDK_AnnotIterator annotIterator(this, true); |
582 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { | 583 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { |
583 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); | 584 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); |
584 pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device); | 585 pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, |
| 586 pOptions->m_bDrawAnnots); |
585 } | 587 } |
586 } | 588 } |
587 | 589 |
588 const CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX, | 590 const CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX, |
589 FX_FLOAT pageY) { | 591 FX_FLOAT pageY) { |
590 for (const auto& pAnnot : m_pAnnotList->All()) { | 592 for (const auto& pAnnot : m_pAnnotList->All()) { |
591 CFX_FloatRect annotRect = pAnnot->GetRect(); | 593 CFX_FloatRect annotRect = pAnnot->GetRect(); |
592 if (annotRect.Contains(pageX, pageY)) | 594 if (annotRect.Contains(pageX, pageY)) |
593 return pAnnot.get(); | 595 return pAnnot.get(); |
594 } | 596 } |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 return pAnnot; | 1036 return pAnnot; |
1035 } | 1037 } |
1036 return nullptr; | 1038 return nullptr; |
1037 } | 1039 } |
1038 | 1040 |
1039 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { | 1041 int CPDFSDK_PageView::GetPageIndexForStaticPDF() const { |
1040 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; | 1042 CPDF_Dictionary* pDict = GetPDFPage()->m_pFormDict; |
1041 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); | 1043 CPDF_Document* pDoc = m_pSDKDoc->GetPDFDocument(); |
1042 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; | 1044 return (pDoc && pDict) ? pDoc->GetPageIndex(pDict->GetObjNum()) : -1; |
1043 } | 1045 } |
OLD | NEW |