| 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 "xfa/fxfa/app/xfa_fwladapter.h" | 7 #include "xfa/fxfa/app/xfa_fwladapter.h" |
| 8 | 8 |
| 9 #include "xfa/fxfa/app/xfa_fffield.h" | 9 #include "xfa/fxfa/app/xfa_fffield.h" |
| 10 #include "xfa/fxfa/include/xfa_ffdoc.h" | 10 #include "xfa/fxfa/include/xfa_ffdoc.h" |
| 11 | 11 |
| 12 CXFA_FWLAdapterWidgetMgr::CXFA_FWLAdapterWidgetMgr() {} |
| 13 |
| 14 CXFA_FWLAdapterWidgetMgr::~CXFA_FWLAdapterWidgetMgr() {} |
| 15 |
| 12 FWL_ERR CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, | 16 FWL_ERR CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget, |
| 13 const CFX_RectF* pRect) { | 17 const CFX_RectF* pRect) { |
| 14 if (!pWidget) | 18 if (!pWidget) |
| 15 return FWL_ERR_Indefinite; | 19 return FWL_ERR_Indefinite; |
| 16 CXFA_FFField* pField = (CXFA_FFField*)pWidget->GetPrivateData(pWidget); | 20 CXFA_FFField* pField = (CXFA_FFField*)pWidget->GetPrivateData(pWidget); |
| 17 if (!pField) | 21 if (!pField) |
| 18 return FWL_ERR_Indefinite; | 22 return FWL_ERR_Indefinite; |
| 19 pField->AddInvalidateRect(nullptr); | 23 pField->AddInvalidateRect(nullptr); |
| 20 return FWL_ERR_Succeeded; | 24 return FWL_ERR_Succeeded; |
| 21 } | 25 } |
| 22 | 26 |
| 23 FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, | 27 FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget, |
| 24 FX_FLOAT fMinHeight, | 28 FX_FLOAT fMinHeight, |
| 25 FX_FLOAT fMaxHeight, | 29 FX_FLOAT fMaxHeight, |
| 26 const CFX_RectF& rtAnchor, | 30 const CFX_RectF& rtAnchor, |
| 27 CFX_RectF& rtPopup) { | 31 CFX_RectF& rtPopup) { |
| 28 CXFA_FFWidget* pFFWidget = (CXFA_FFWidget*)(pWidget->GetPrivateData(pWidget)); | 32 CXFA_FFWidget* pFFWidget = (CXFA_FFWidget*)(pWidget->GetPrivateData(pWidget)); |
| 29 CFX_Matrix mt; | 33 CFX_Matrix mt; |
| 30 pFFWidget->GetRotateMatrix(mt); | 34 pFFWidget->GetRotateMatrix(mt); |
| 31 CFX_RectF rtRotateAnchor(rtAnchor); | 35 CFX_RectF rtRotateAnchor(rtAnchor); |
| 32 mt.TransformRect(rtRotateAnchor); | 36 mt.TransformRect(rtRotateAnchor); |
| 33 pFFWidget->GetDoc()->GetDocProvider()->GetPopupPos( | 37 pFFWidget->GetDoc()->GetDocProvider()->GetPopupPos( |
| 34 pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); | 38 pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); |
| 35 return TRUE; | 39 return TRUE; |
| 36 } | 40 } |
| OLD | NEW |