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