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/formfiller/cffl_formfiller.h" | 7 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
10 #include "core/fxge/include/cfx_renderdevice.h" | 10 #include "core/fxge/include/cfx_renderdevice.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 rcWin.Union(rcFocus); | 76 rcWin.Union(rcFocus); |
77 | 77 |
78 CFX_FloatRect rect = CPWL_Utils::InflateRect(rcWin, 1); | 78 CFX_FloatRect rect = CPWL_Utils::InflateRect(rcWin, 1); |
79 | 79 |
80 return rect.GetOuterRect(); | 80 return rect.GetOuterRect(); |
81 } | 81 } |
82 | 82 |
83 void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView, | 83 void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView, |
84 CPDFSDK_Annot* pAnnot, | 84 CPDFSDK_Annot* pAnnot, |
85 CFX_RenderDevice* pDevice, | 85 CFX_RenderDevice* pDevice, |
86 CFX_Matrix* pUser2Device, | 86 CFX_Matrix* pUser2Device) { |
87 uint32_t dwFlags) { | |
88 ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); | 87 ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); |
89 | 88 |
90 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { | 89 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { |
91 CFX_Matrix mt = GetCurMatrix(); | 90 CFX_Matrix mt = GetCurMatrix(); |
92 mt.Concat(*pUser2Device); | 91 mt.Concat(*pUser2Device); |
93 pWnd->DrawAppearance(pDevice, &mt); | 92 pWnd->DrawAppearance(pDevice, &mt); |
94 } else { | 93 } else { |
95 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 94 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
96 if (CFFL_IFormFiller::IsVisible(pWidget)) | 95 if (CFFL_IFormFiller::IsVisible(pWidget)) |
97 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, | 96 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, |
98 nullptr); | 97 nullptr); |
99 } | 98 } |
100 } | 99 } |
101 | 100 |
102 void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView* pPageView, | 101 void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView* pPageView, |
103 CPDFSDK_Annot* pAnnot, | 102 CPDFSDK_Annot* pAnnot, |
104 CFX_RenderDevice* pDevice, | 103 CFX_RenderDevice* pDevice, |
105 CFX_Matrix* pUser2Device, | 104 CFX_Matrix* pUser2Device) { |
106 uint32_t dwFlags) { | |
107 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 105 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
108 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 106 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
109 } | 107 } |
110 | 108 |
111 void CFFL_FormFiller::OnCreate(CPDFSDK_Annot* pAnnot) {} | 109 void CFFL_FormFiller::OnCreate(CPDFSDK_Annot* pAnnot) {} |
112 | 110 |
113 void CFFL_FormFiller::OnLoad(CPDFSDK_Annot* pAnnot) {} | 111 void CFFL_FormFiller::OnLoad(CPDFSDK_Annot* pAnnot) {} |
114 | 112 |
115 void CFFL_FormFiller::OnDelete(CPDFSDK_Annot* pAnnot) {} | 113 void CFFL_FormFiller::OnDelete(CPDFSDK_Annot* pAnnot) {} |
116 | 114 |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 FX_UINT nFlags, | 678 FX_UINT nFlags, |
681 const CFX_FloatPoint& point) { | 679 const CFX_FloatPoint& point) { |
682 ASSERT(m_pApp); | 680 ASSERT(m_pApp); |
683 | 681 |
684 return TRUE; | 682 return TRUE; |
685 } | 683 } |
686 | 684 |
687 void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView, | 685 void CFFL_Button::OnDraw(CPDFSDK_PageView* pPageView, |
688 CPDFSDK_Annot* pAnnot, | 686 CPDFSDK_Annot* pAnnot, |
689 CFX_RenderDevice* pDevice, | 687 CFX_RenderDevice* pDevice, |
690 CFX_Matrix* pUser2Device, | 688 CFX_Matrix* pUser2Device) { |
691 uint32_t dwFlags) { | |
692 ASSERT(pPageView); | 689 ASSERT(pPageView); |
693 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 690 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
694 CPDF_FormControl* pCtrl = pWidget->GetFormControl(); | 691 CPDF_FormControl* pCtrl = pWidget->GetFormControl(); |
695 CPDF_FormControl::HighlightingMode eHM = pCtrl->GetHighlightingMode(); | 692 CPDF_FormControl::HighlightingMode eHM = pCtrl->GetHighlightingMode(); |
696 | 693 |
697 if (eHM != CPDF_FormControl::Push) { | 694 if (eHM != CPDF_FormControl::Push) { |
698 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 695 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
699 return; | 696 return; |
700 } | 697 } |
701 | 698 |
(...skipping 11 matching lines...) Expand all Loading... |
713 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, | 710 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, |
714 nullptr); | 711 nullptr); |
715 } else { | 712 } else { |
716 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 713 pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
717 } | 714 } |
718 } | 715 } |
719 | 716 |
720 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, | 717 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, |
721 CPDFSDK_Annot* pAnnot, | 718 CPDFSDK_Annot* pAnnot, |
722 CFX_RenderDevice* pDevice, | 719 CFX_RenderDevice* pDevice, |
723 CFX_Matrix* pUser2Device, | 720 CFX_Matrix* pUser2Device) { |
724 uint32_t dwFlags) { | 721 OnDraw(pPageView, pAnnot, pDevice, pUser2Device); |
725 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | |
726 } | 722 } |
OLD | NEW |