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/xfa_ffdoc.h" | 10 #include "xfa/fxfa/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 void CXFA_FWLAdapterWidgetMgr::RepaintWidget(CFWL_Widget* pWidget, | 16 void CXFA_FWLAdapterWidgetMgr::RepaintWidget(CFWL_Widget* pWidget) { |
17 const CFX_RectF* pRect) { | |
18 if (!pWidget) | 17 if (!pWidget) |
19 return; | 18 return; |
20 | 19 |
21 CXFA_FFWidget* pFFWidget = | 20 CXFA_FFWidget* pFFWidget = |
22 static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 21 static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); |
23 if (!pFFWidget) | 22 if (!pFFWidget) |
24 return; | 23 return; |
25 | 24 |
26 pFFWidget->AddInvalidateRect(nullptr); | 25 pFFWidget->AddInvalidateRect(nullptr); |
27 } | 26 } |
28 | 27 |
29 bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(CFWL_Widget* pWidget, | 28 bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(CFWL_Widget* pWidget, |
30 FX_FLOAT fMinHeight, | 29 FX_FLOAT fMinHeight, |
31 FX_FLOAT fMaxHeight, | 30 FX_FLOAT fMaxHeight, |
32 const CFX_RectF& rtAnchor, | 31 const CFX_RectF& rtAnchor, |
33 CFX_RectF& rtPopup) { | 32 CFX_RectF& rtPopup) { |
34 CXFA_FFWidget* pFFWidget = | 33 CXFA_FFWidget* pFFWidget = |
35 static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); | 34 static_cast<CXFA_FFWidget*>(pWidget->GetLayoutItem()); |
36 CFX_Matrix mt; | 35 CFX_Matrix mt; |
37 pFFWidget->GetRotateMatrix(mt); | 36 pFFWidget->GetRotateMatrix(mt); |
38 CFX_RectF rtRotateAnchor(rtAnchor); | 37 CFX_RectF rtRotateAnchor(rtAnchor); |
39 mt.TransformRect(rtRotateAnchor); | 38 mt.TransformRect(rtRotateAnchor); |
40 pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos( | 39 pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos( |
41 pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); | 40 pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, rtPopup); |
42 return true; | 41 return true; |
43 } | 42 } |
OLD | NEW |