| 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_xfawidgethandler.h" | 7 #include "fpdfsdk/cpdfsdk_xfawidgethandler.h" |
| 8 | 8 |
| 9 #include "core/fpdfdoc/cpdf_interform.h" | 9 #include "core/fpdfdoc/cpdf_interform.h" |
| 10 #include "fpdfsdk/cpdfsdk_annot.h" | 10 #include "fpdfsdk/cpdfsdk_annot.h" |
| 11 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" | 11 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
| 12 #include "fpdfsdk/cpdfsdk_interform.h" | 12 #include "fpdfsdk/cpdfsdk_interform.h" |
| 13 #include "fpdfsdk/cpdfsdk_pageview.h" | 13 #include "fpdfsdk/cpdfsdk_pageview.h" |
| 14 #include "fpdfsdk/cpdfsdk_xfawidget.h" | 14 #include "fpdfsdk/cpdfsdk_xfawidget.h" |
| 15 #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" | 15 #include "fpdfsdk/fpdfxfa/cpdfxfa_document.h" |
| 16 #include "xfa/fwl/core/fwl_widgethit.h" | 16 #include "xfa/fwl/core/fwl_widgethit.h" |
| 17 #include "xfa/fxfa/fxfa_basic.h" | 17 #include "xfa/fxfa/fxfa_basic.h" |
| 18 #include "xfa/fxfa/xfa_ffdocview.h" | 18 #include "xfa/fxfa/xfa_ffdocview.h" |
| 19 #include "xfa/fxfa/xfa_ffpageview.h" | 19 #include "xfa/fxfa/xfa_ffpageview.h" |
| 20 #include "xfa/fxfa/xfa_ffwidget.h" | 20 #include "xfa/fxfa/xfa_ffwidget.h" |
| 21 #include "xfa/fxfa/xfa_ffwidgethandler.h" | 21 #include "xfa/fxfa/xfa_ffwidgethandler.h" |
| 22 #include "xfa/fxgraphics/cfx_graphics.h" | 22 #include "xfa/fxgraphics/cfx_graphics.h" |
| 23 | 23 |
| 24 CPDFSDK_XFAWidgetHandler::CPDFSDK_XFAWidgetHandler( | 24 CPDFSDK_XFAWidgetHandler::CPDFSDK_XFAWidgetHandler( |
| 25 CPDFSDK_FormFillEnvironment* pEnv) | 25 CPDFSDK_FormFillEnvironment* pFormFillEnv) |
| 26 : m_pEnv(pEnv) {} | 26 : m_pFormFillEnv(pFormFillEnv) {} |
| 27 | 27 |
| 28 CPDFSDK_XFAWidgetHandler::~CPDFSDK_XFAWidgetHandler() {} | 28 CPDFSDK_XFAWidgetHandler::~CPDFSDK_XFAWidgetHandler() {} |
| 29 | 29 |
| 30 FX_BOOL CPDFSDK_XFAWidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { | 30 FX_BOOL CPDFSDK_XFAWidgetHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { |
| 31 return !!pAnnot->GetXFAWidget(); | 31 return !!pAnnot->GetXFAWidget(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CPDF_Annot* pAnnot, | 34 CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CPDF_Annot* pAnnot, |
| 35 CPDFSDK_PageView* pPage) { | 35 CPDFSDK_PageView* pPage) { |
| 36 return nullptr; | 36 return nullptr; |
| 37 } | 37 } |
| 38 | 38 |
| 39 CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CXFA_FFWidget* pAnnot, | 39 CPDFSDK_Annot* CPDFSDK_XFAWidgetHandler::NewAnnot(CXFA_FFWidget* pAnnot, |
| 40 CPDFSDK_PageView* pPage) { | 40 CPDFSDK_PageView* pPage) { |
| 41 CPDFSDK_InterForm* pInterForm = m_pEnv->GetInterForm(); | 41 CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm(); |
| 42 CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm); | 42 CPDFSDK_XFAWidget* pWidget = new CPDFSDK_XFAWidget(pAnnot, pPage, pInterForm); |
| 43 pInterForm->AddXFAMap(pAnnot, pWidget); | 43 pInterForm->AddXFAMap(pAnnot, pWidget); |
| 44 return pWidget; | 44 return pWidget; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void CPDFSDK_XFAWidgetHandler::OnDraw(CPDFSDK_PageView* pPageView, | 47 void CPDFSDK_XFAWidgetHandler::OnDraw(CPDFSDK_PageView* pPageView, |
| 48 CPDFSDK_Annot* pAnnot, | 48 CPDFSDK_Annot* pAnnot, |
| 49 CFX_RenderDevice* pDevice, | 49 CFX_RenderDevice* pDevice, |
| 50 CFX_Matrix* pUser2Device, | 50 CFX_Matrix* pUser2Device, |
| 51 bool bDrawAnnots) { | 51 bool bDrawAnnots) { |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 dwFWLFlag |= FWL_KEYFLAG_MButton; | 375 dwFWLFlag |= FWL_KEYFLAG_MButton; |
| 376 if (dwFlag & FWL_EVENTFLAG_RightButtonDown) | 376 if (dwFlag & FWL_EVENTFLAG_RightButtonDown) |
| 377 dwFWLFlag |= FWL_KEYFLAG_RButton; | 377 dwFWLFlag |= FWL_KEYFLAG_RButton; |
| 378 if (dwFlag & FWL_EVENTFLAG_ShiftKey) | 378 if (dwFlag & FWL_EVENTFLAG_ShiftKey) |
| 379 dwFWLFlag |= FWL_KEYFLAG_Shift; | 379 dwFWLFlag |= FWL_KEYFLAG_Shift; |
| 380 if (dwFlag & FWL_EVENTFLAG_AltKey) | 380 if (dwFlag & FWL_EVENTFLAG_AltKey) |
| 381 dwFWLFlag |= FWL_KEYFLAG_Alt; | 381 dwFWLFlag |= FWL_KEYFLAG_Alt; |
| 382 | 382 |
| 383 return dwFWLFlag; | 383 return dwFWLFlag; |
| 384 } | 384 } |
| OLD | NEW |