| 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/formfiller/FFL_FormFiller.h" | 7 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
| 8 | 8 |
| 9 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" | 9 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" |
| 10 #include "fpdfsdk/include/fsdk_common.h" | 10 #include "fpdfsdk/include/fsdk_common.h" |
| 11 #include "fpdfsdk/include/fsdk_mgr.h" | 11 #include "fpdfsdk/include/fsdk_mgr.h" |
| 12 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" | 12 #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" |
| 13 | 13 |
| 14 #define GetRed(rgb) ((uint8_t)(rgb)) | 14 #define GetRed(rgb) ((uint8_t)(rgb)) |
| 15 #define GetGreen(rgb) ((uint8_t)(((FX_WORD)(rgb)) >> 8)) | 15 #define GetGreen(rgb) ((uint8_t)(((FX_WORD)(rgb)) >> 8)) |
| 16 #define GetBlue(rgb) ((uint8_t)((rgb) >> 16)) | 16 #define GetBlue(rgb) ((uint8_t)((rgb) >> 16)) |
| 17 | 17 |
| 18 #define FFL_HINT_ELAPSE 800 | 18 #define FFL_HINT_ELAPSE 800 |
| 19 | 19 |
| 20 CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, | 20 CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, |
| 21 CPDFSDK_Annot* pAnnot) | 21 CPDFSDK_Annot* pAnnot) |
| 22 : m_pApp(pApp), m_pAnnot(pAnnot), m_bValid(FALSE), m_ptOldPos(0, 0) { | 22 : m_pApp(pApp), m_pAnnot(pAnnot), m_bValid(FALSE), m_ptOldPos(0, 0) { |
| 23 m_pWidget = (CPDFSDK_Widget*)pAnnot; | 23 m_pWidget = (CPDFSDK_Widget*)pAnnot; |
| 24 } | 24 } |
| 25 | 25 |
| 26 CFFL_FormFiller::~CFFL_FormFiller() { | 26 CFFL_FormFiller::~CFFL_FormFiller() { |
| 27 for (auto& it : m_Maps) { | 27 for (const auto& it : m_Maps) { |
| 28 CPWL_Wnd* pWnd = it.second; | 28 CPWL_Wnd* pWnd = it.second; |
| 29 CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData(); | 29 CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData(); |
| 30 pWnd->InvalidateProvider(this); |
| 30 pWnd->Destroy(); | 31 pWnd->Destroy(); |
| 31 delete pWnd; | 32 delete pWnd; |
| 32 delete pData; | 33 delete pData; |
| 33 } | 34 } |
| 34 m_Maps.clear(); | 35 m_Maps.clear(); |
| 35 } | 36 } |
| 36 | 37 |
| 37 void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, | 38 void CFFL_FormFiller::SetWindowRect(CPDFSDK_PageView* pPageView, |
| 38 const CPDF_Rect& rcWindow) { | 39 const CPDF_Rect& rcWindow) { |
| 39 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { | 40 if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) { |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 } | 718 } |
| 718 } | 719 } |
| 719 | 720 |
| 720 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, | 721 void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView* pPageView, |
| 721 CPDFSDK_Annot* pAnnot, | 722 CPDFSDK_Annot* pAnnot, |
| 722 CFX_RenderDevice* pDevice, | 723 CFX_RenderDevice* pDevice, |
| 723 CFX_Matrix* pUser2Device, | 724 CFX_Matrix* pUser2Device, |
| 724 FX_DWORD dwFlags) { | 725 FX_DWORD dwFlags) { |
| 725 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 726 OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
| 726 } | 727 } |
| OLD | NEW |